Skip to content

Commit 25b0ab5

Browse files
committed
Enable OSX build
1 parent ac6bdd0 commit 25b0ab5

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

.travis.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,16 @@ matrix:
1010
include:
1111
- os: linux
1212
rust: stable
13-
# - os: osx
14-
# rust: stable
13+
- os: osx
14+
osx_image: xcode8
15+
rust: stable
1516

1617
install:
1718
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./build_linux.sh; fi
18-
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
19-
brew config;
20-
brew update;
21-
brew install -v https://raw.githubusercontent.com/Homebrew/homebrew-versions/master/llvm38.rb; fi
22-
19+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then ./build_osx.sh; fi
2320
script:
2421
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then export LIBCLANG_STATIC_PATH=~/clang/lib; fi
25-
- 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
22+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export LLVM_CONFIG_PATH=/clang/bin/llvm-config; fi
2623
- cargo build --verbose --features "clang_3_8 static"
2724
- RUST_TEST_THREADS=1 cargo test --verbose --features "clang_3_8 static"
2825

build_osx.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
set -x
3+
set -o errexit
4+
brew config;
5+
brew update;
6+
brew install --force curl ninja
7+
pushd $HOME
8+
if [ ! -d "llvm/tools" ]; then rm -rf llvm; git clone -b release_38 --depth=1 https://github.com/llvm-mirror/llvm.git; fi
9+
pushd llvm
10+
pushd tools
11+
if [ ! -d "clang" ]; then git clone -b release_38 --depth=1 https://github.com/llvm-mirror/clang.git; fi
12+
popd
13+
mkdir -p _build
14+
pushd _build
15+
cmake .. -DLIBCLANG_BUILD_STATIC=On -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/clang -DLLVM_TARGETS_TO_BUILD=X86 -GNinja
16+
ninja
17+
sudo mkdir -p /clang
18+
sudo ninja install
19+
sudo cp lib/libclang.a /clang/lib
20+
popd
21+
popd
22+
popd

0 commit comments

Comments
 (0)