-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathbuild-default.sh
executable file
·37 lines (30 loc) · 984 Bytes
/
build-default.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
#!/usr/bin/env bash
sysOS=$(uname -s)
NUM_THREADS=1
if [ $sysOS == "Darwin" ]; then
#echo "I'm MacOS"
NUM_THREADS=$(sysctl -n hw.nCPU)
elif [ $sysOS == "Linux" ]; then
#echo "I'm Linux"
NUM_THREADS=$(grep ^processor /proc/cpuinfo | wc -l)
else
echo "Other OS: $sysOS"
fi
mkdir -p ${sysOS}-BIN
pushd ${sysOS}-BIN
cmake -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release -DOCR_OUTPUT="BIN" ..
cmake --build . --config Release -j $NUM_THREADS
cmake --build . --config Release --target install
popd
mkdir -p ${sysOS}-JNI
pushd ${sysOS}-JNI
cmake -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release -DOCR_OUTPUT="JNI" ..
cmake --build . --config Release -j $NUM_THREADS
cmake --build . --config Release --target install
popd
mkdir -p ${sysOS}-CLIB
pushd ${sysOS}-CLIB
cmake -DCMAKE_INSTALL_PREFIX=install -DCMAKE_BUILD_TYPE=Release -DOCR_OUTPUT="CLIB" ..
cmake --build . --config Release -j $NUM_THREADS
cmake --build . --config Release --target install
popd