solvespace/.travis/build-macos.sh
Koen Schmeets 8e7416f3fd
Travis: Build improvements and fixes (#751)
- Add OpenMP to macOS build
- Use as many cores as possible in CI
- Update travis osx image to xcode12.2
- Ignore .vscode folder
- In `.travis/sign-macos.sh`, only create keychain when `CI` variable is present
- Only run macOS deploy stage when a tag is pushed
2020-10-20 09:39:26 +02:00

26 lines
572 B
Bash
Executable File

#!/bin/sh -xe
if echo $TRAVIS_TAG | grep ^v; then
BUILD_TYPE=RelWithDebInfo
else
BUILD_TYPE=Debug
fi
mkdir build || true
cd build
LLVM_PREFIX=$(brew --prefix llvm@9)
export CC="${LLVM_PREFIX}/bin/clang"
export CXX="${CC}++"
export LDFLAGS="-L${LLVM_PREFIX}/lib -Wl,-rpath,${LLVM_PREFIX}/lib" \
export CFLAGS="-I${LLVM_PREFIX}/include"
export CPPFLAGS="-I${LLVM_PREFIX}/include"
cmake \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 \
-DCMAKE_BUILD_TYPE=$BUILD_TYPE .. \
-DENABLE_OPENMP=ON
cmake --build . --config $BUILD_TYPE
make -j$(nproc) test_solvespace