Skip to content

Commit

Permalink
Enable OSX build
Browse files Browse the repository at this point in the history
  • Loading branch information
jupp0r committed Aug 25, 2016
1 parent ac6bdd0 commit 25b0ab5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 8 deletions.
13 changes: 5 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
22 changes: 22 additions & 0 deletions build_osx.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 25b0ab5

Please sign in to comment.