diff --git a/config-amdgpu.sh.template b/config-amdgpu.sh.template index 3f2c31b..2df3c04 100644 --- a/config-amdgpu.sh.template +++ b/config-amdgpu.sh.template @@ -1,12 +1,11 @@ # use Debug or Release : ${BUILD_TYPE:=Debug} +: ${BUILD_JOBS:="8"} : ${CMAKE_MAKE:=""} -: ${MAKE:="make -j4"} # use this for ninja instead of make #: ${CMAKE_MAKE:="-G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLLVM_PARALLEL_COMPILE_JOBS=4 -DLLVM_PARALLEL_LINK_JOBS=1"} -#: ${MAKE:="ninja"} # set this to true if you don't have a github account : ${HTTPS:=true} diff --git a/config.sh.template b/config.sh.template index 182a2ed..31a11b8 100644 --- a/config.sh.template +++ b/config.sh.template @@ -1,12 +1,11 @@ # use Debug or Release : ${BUILD_TYPE:=Debug} +: ${BUILD_JOBS:="8"} : ${CMAKE_MAKE:=""} -: ${MAKE:="make -j4"} # use this for ninja instead of make #: ${CMAKE_MAKE:="-G Ninja -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DLLVM_PARALLEL_COMPILE_JOBS=4 -DLLVM_PARALLEL_LINK_JOBS=1"} -#: ${MAKE:="ninja"} # set this to true if you don't have a github account : ${HTTPS:=true} diff --git a/setup.sh b/setup.sh index 3c434e5..70bca58 100755 --- a/setup.sh +++ b/setup.sh @@ -40,6 +40,14 @@ source config.sh CUR=`pwd` +if [ ! -v BUILD_JOBS ]; then + echo "Please specify BUILD_JOBS in the config.sh file" + exit -1 +fi + +MAKE="cmake --build . --config ${BUILD_TYPE} -j ${BUILD_JOBS}" +MAKE_INSTALL="cmake --install . --config ${BUILD_TYPE}" + function remote { if $HTTPS; then echo "https://github.com/$1" @@ -83,7 +91,8 @@ if [ "${CMAKE-}" == true ]; then cd cmake_build cmake ../CMake -DBUILD_CursesDialog:BOOL=ON -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH="${CUR}/cmake_install" - ${MAKE} install + ${MAKE} + ${MAKE_INSTALL} cd "${CUR}" export PATH="${CUR}/cmake_install/bin:${PATH}" @@ -130,7 +139,8 @@ if [ "${LLVM-}" == true ]; then fi cmake ../llvm-project/llvm ${CMAKE_MAKE} -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON -DLLVM_LINK_LLVM_DYLIB:BOOL=ON -DCMAKE_BUILD_TYPE:STRING=${BUILD_TYPE} -DCMAKE_INSTALL_PREFIX:PATH="${CUR}/llvm_install" \ -DLLVM_ENABLE_RTTI:BOOL=ON -DLLVM_ENABLE_PROJECTS:STRING="clang;lld" -DLLVM_ENABLE_BINDINGS:BOOL=OFF -DLLVM_INCLUDE_TESTS:BOOL=ON -DLLVM_TARGETS_TO_BUILD:STRING="${LLVM_TARGETS}" -DDEFAULT_SYSROOT:PATH="${DEFAULT_SYSROOT}" - ${MAKE} install + ${MAKE} + ${MAKE_INSTALL} cd "${CUR}" LLVM_VARS=-DLLVM_DIR:PATH="${CUR}/llvm_install/lib/cmake/llvm"