diff --git a/.travis.yml b/.travis.yml index fe5435e..4c936b8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,19 +10,16 @@ matrix: include: - os: linux rust: stable -# - os: osx -# rust: stable + - os: osx + osx_image: xcode8 + rust: stable install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./build_linux.sh; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - brew config; - brew update; - brew install -v https://raw.githubusercontent.com/Homebrew/homebrew-versions/master/llvm38.rb; fi - + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./build_osx.sh; fi script: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export LIBCLANG_STATIC_PATH=~/clang/lib; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export LLVM_CONFIG_PATH=/usr/local/bin/llvm-config-3.8; export LIBCLANG_STATIC_PATH=`/usr/local/bin/llvm-config-3.8 --libdir`; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export LLVM_CONFIG_PATH=/clang/bin/llvm-config; fi - cargo build --verbose --features "clang_3_8 static" - RUST_TEST_THREADS=1 cargo test --verbose --features "clang_3_8 static" diff --git a/build_osx.sh b/build_osx.sh new file mode 100755 index 0000000..c180013 --- /dev/null +++ b/build_osx.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +set -x +set -o errexit +brew config; +brew update; +brew install --force curl ninja +pushd $HOME +if [ ! -d "llvm/tools" ]; then rm -rf llvm; git clone -b release_38 --depth=1 https://github.com/llvm-mirror/llvm.git; fi +pushd llvm +pushd tools +if [ ! -d "clang" ]; then git clone -b release_38 --depth=1 https://github.com/llvm-mirror/clang.git; fi +popd +mkdir -p _build +pushd _build +cmake .. -DLIBCLANG_BUILD_STATIC=On -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/clang -DLLVM_TARGETS_TO_BUILD=X86 -GNinja +ninja +sudo mkdir -p /clang +sudo ninja install +sudo cp lib/libclang.a /clang/lib +popd +popd +popd