-
Notifications
You must be signed in to change notification settings - Fork 59
/
build-osx.sh
executable file
·51 lines (38 loc) · 1.4 KB
/
build-osx.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
python3 -m pip install -r docs/requirements.txt --force-reinstall
BUILD_DIR=build-osx
EMBREE_ZIP="https://github.com/embree/embree/releases/download/v3.13.1/embree-3.13.1.x86_64.macosx.zip"
# embree-3.13.1.x86_64.macosx.zip
EMBREE_ZIP_NAME=$(basename "$EMBREE_ZIP")
# embree-3.13.1.x86_64.macosx
EMBREE_DIR_NAME=$(basename "$EMBREE_ZIP_NAME" ".zip")
TBB_TGZ="https://github.com/oneapi-src/oneTBB/releases/download/v2021.3.0/oneapi-tbb-2021.3.0-mac.tgz"
TBB_TGZ_NAME=$(basename "$TBB_TGZ")
TBB_DIR_NAME="oneapi-tbb-2021.3.0"
if [ -d "$BUILD_DIR" ]; then
echo "$BUILD_DIR already exists, remove it first"
exit 1
fi
mkdir "$BUILD_DIR"
cd "$BUILD_DIR"
wget -q "$EMBREE_ZIP"
unzip -q "$EMBREE_ZIP_NAME"
wget -q "$TBB_TGZ"
tar xf "$TBB_TGZ_NAME"
EMBREE_CMAKE_DIR="$(pwd)/$EMBREE_DIR_NAME/lib/cmake/embree-3.13.1"
TBB_CMAKE_DIR="$(pwd)/${TBB_DIR_NAME}/lib/cmake"
# check USE_ASAN environment variable (see cmake.yml)
if [ "$USE_ASAN" == "YES" ]; then
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH="$EMBREE_CMAKE_DIR;$TBB_CMAKE_DIR" -DENABLE_LIGHTPREVIEW=YES -DERICWTOOLS_ASAN=YES
else
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$EMBREE_CMAKE_DIR;$TBB_CMAKE_DIR"
fi
make -j8 package || exit 1
# print shared libraries used
otool -L ./light/light
otool -L ./qbsp/qbsp
otool -L ./vis/vis
otool -L ./bspinfo/bspinfo
otool -L ./bsputil/bsputil
# run tests
./tests/tests || exit 1