2016-04-19 12:19:00 +00:00
|
|
|
#!/bin/sh -xe
|
|
|
|
|
2020-10-20 07:39:26 +00:00
|
|
|
mkdir build || true
|
2016-04-19 12:19:00 +00:00
|
|
|
cd build
|
2020-10-20 07:39:26 +00:00
|
|
|
|
2020-10-20 15:31:26 +00:00
|
|
|
OSX_TARGET="10.9"
|
2020-10-20 07:39:26 +00:00
|
|
|
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"
|
|
|
|
|
2020-10-21 19:13:49 +00:00
|
|
|
if [ "$1" == "release" ]; then
|
2020-10-20 15:31:26 +00:00
|
|
|
BUILD_TYPE=RelWithDebInfo
|
|
|
|
cmake \
|
|
|
|
-DCMAKE_OSX_DEPLOYMENT_TARGET="${OSX_TARGET}" \
|
|
|
|
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" .. \
|
|
|
|
-DENABLE_OPENMP=ON \
|
|
|
|
-DENABLE_LTO=ON
|
|
|
|
else
|
|
|
|
BUILD_TYPE=Debug
|
|
|
|
cmake \
|
|
|
|
-DCMAKE_OSX_DEPLOYMENT_TARGET="${OSX_TARGET}" \
|
|
|
|
-DCMAKE_BUILD_TYPE="${BUILD_TYPE}" ..
|
|
|
|
fi
|
2020-10-20 07:39:26 +00:00
|
|
|
|
2020-10-20 15:31:26 +00:00
|
|
|
cmake --build . --config "${BUILD_TYPE}" -- -j$(nproc)
|
2020-10-20 07:39:26 +00:00
|
|
|
make -j$(nproc) test_solvespace
|