There was an error while loading. Please reload this page.
1 parent 1625de5 commit 9a2506bCopy full SHA for 9a2506b
cppbuild/cppbuild
@@ -3,11 +3,23 @@
3
SOURCE_DIR="`pwd`"
4
BUILD_DIR="`pwd`/cppbuild/Release"
5
6
+ncpus=1
7
+case "`uname`" in
8
+ Darwin* )
9
+ ncpus=`sysctl -n hw.ncpu`
10
+ ;;
11
+ Linux*)
12
+ ncpus=$(lscpu -p | egrep -v '^#' | wc -l)
13
14
+esac
15
+
16
+echo "Will make with \"-j $ncpus\"."
17
18
if [ -d "$BUILD_DIR" ] ; then
19
echo "Build directory ($BUILD_DIR) exists, removing."
20
rm -rf $BUILD_DIR
21
fi
22
23
mkdir -p $BUILD_DIR
24
-(cd $BUILD_DIR && cmake -G "Unix Makefiles" $SOURCE_DIR && make clean && make all && ctest -C Release)
25
+(cd $BUILD_DIR && cmake -G "Unix Makefiles" $SOURCE_DIR && make clean && make -j "$ncpus" all && ctest -C Release)
0 commit comments