summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-09-15 01:47:23 +0200
committerSven Gothel <[email protected]>2020-09-15 01:47:23 +0200
commitf6a9761008c87967d2790e78e362e6366d8fa8af (patch)
treeebd446a1322e331c9917f4aed91831b0e69b765c /scripts
parent24cc8c1bca73f484d21fe8a8b2ab8b0c39d71097 (diff)
CMake: Support full parallel build by adding target dependencies
C++ Libs -> none (2x) Java Jar -> none Java JNI Libs -> C++ Lib + Java Jar (2x) C++ Examples -> C++ Libs Java Examples -> Java Jar Test -> C++ Lib +++ scripts/[re]build.sh uses `getconf _NPROCESSORS_ONLN` for the make -j <number of parallel processes>.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/build.sh6
-rw-r--r--scripts/rebuild.sh5
2 files changed, 8 insertions, 3 deletions
diff --git a/scripts/build.sh b/scripts/build.sh
index acd2bcc3..e03b1eda 100644
--- a/scripts/build.sh
+++ b/scripts/build.sh
@@ -14,9 +14,12 @@ if [ ! -e $JAVA_HOME ] ; then
exit 1
fi
+CPU_COUNT=`getconf _NPROCESSORS_ONLN`
+
buildit() {
echo rootdir $rootdir
echo logfile $logfile
+ echo CPU_COUNT $CPU_COUNT
cd $rootdir
rm -rf dist-$archabi
@@ -26,8 +29,7 @@ buildit() {
cd build-$archabi
cmake -DCMAKE_INSTALL_PREFIX=$rootdir/dist-$archabi -DBUILDJAVA=ON -DBUILDEXAMPLES=ON -DBUILD_TESTING=ON ..
# cmake -DCMAKE_INSTALL_PREFIX=$rootdir/dist-$archabi -DBUILDJAVA=ON -DBUILDEXAMPLES=ON -DBUILD_TESTING=ON -DDEBUG=ON ..
- # cmake -DCMAKE_INSTALL_PREFIX=$rootdir/dist-$archabi -DSKIP_TINYB=ON -DBUILDJAVA=ON -DBUILDEXAMPLES=ON -DBUILD_TESTING=ON -DDEBUG=ON ..
- make install test
+ make -j $CPU_COUNT install test
if [ $? -eq 0 ] ; then
echo "BUILD SUCCESS $bname $archabi"
cp -a examples/* $rootdir/dist-$archabi/bin
diff --git a/scripts/rebuild.sh b/scripts/rebuild.sh
index eba3e8a6..5362f09b 100644
--- a/scripts/rebuild.sh
+++ b/scripts/rebuild.sh
@@ -14,12 +14,15 @@ if [ ! -e $JAVA_HOME ] ; then
exit 1
fi
+CPU_COUNT=`getconf _NPROCESSORS_ONLN`
+
buildit() {
echo rootdir $rootdir
echo logfile $logfile
+ echo CPU_COUNT $CPU_COUNT
cd $rootdir/build-$archabi
- make install test
+ make -j $CPU_COUNT install test
if [ $? -eq 0 ] ; then
echo "REBUILD SUCCESS $bname $archabi"
cp -a examples/* $rootdir/dist-$archabi/bin