improve cmake compile

This commit is contained in:
wb-hx510875
2020-03-27 10:59:57 +08:00
committed by page
parent f0c2600a26
commit 31f2c5d410
4 changed files with 12 additions and 79 deletions

View File

@@ -1,5 +1,7 @@
#!/bin/bash
product=$1
MAKE=make
if command -v python > /dev/null ; then
MAKE="make -j $(python -c 'import multiprocessing as mp; print(int(mp.cpu_count()))')"
@@ -10,7 +12,7 @@ echo $MAKE
rm -rf sdk_build
mkdir sdk_build
cd sdk_build
cmake -DBUILD_FUNCTION_TESTS=OFF -DBUILD_UNIT_TESTS=OFF -DENABLE_COVERAGE=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
cmake -DBUILD_PRODUCT="$product" -DBUILD_FUNCTION_TESTS=OFF -DBUILD_UNIT_TESTS=OFF -DENABLE_COVERAGE=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
$MAKE
make install