-
Notifications
You must be signed in to change notification settings - Fork 170
/
build.sh
executable file
·41 lines (32 loc) · 1.08 KB
/
build.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
#!/bin/bash
## Any subsequent(*) commands which fail will cause the shell script to exit immediately, otherwise the job will fail silently.
set -e
# Produce fast and small code (but not debuggable), and produce it to be
# relocatable since in the end we'll link it all together in a shared object.
# Note that cmake seems to clobber the -O3 with a -O2, but we can dream.
export CXXFLAGS="-O3 -fomit-frame-pointer -fPIC"
export CFLAGS="-O3 -fomit-frame-pointer -fPIC"
if [ "$(uname)" == "Darwin" ]; then
export CXXFLAGS="${CXXFLAGS} -arch x86_64 -arch arm64"
export CFLAGS="${CFLAGS} -arch x86_64 -arch arm64"
export MACOSX_DEPLOYMENT_TARGET=10.14
fi
export MAKEFLAGS="-j12"
pushd External
./build.sh
popd
if [[ -e build ]]; then
rm -rf build
fi
depsdir=${PWD}/External/install
installdir=${PWD}
mkdir -p build
pushd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DALEMBIC_DIR=${depsdir} \
-DUSE_STATIC=ON \
-DENABLE_DEPLOY=OFF \
-DCMAKE_PREFIX_PATH=${depsdir} \
-DCMAKE_INSTALL_PREFIX=${installdir}
cmake --build . --target install --config RelWithDebInfo
popd