From f230f5de0f19a5874431c0015020904b7301009b Mon Sep 17 00:00:00 2001 From: Paul Fultz II Date: Thu, 22 Sep 2016 00:17:06 -0500 Subject: [PATCH 1/2] Set the NUM_BUILD_THREADS to processor cores by default --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 99b2053ec53..9ab17bdc5c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,8 @@ ENDIF (NOT CLANG_URL) set(CMAKE_MACOSX_RPATH 1) IF (NOT NUM_BUILD_THREADS) - SET(NUM_BUILD_THREADS 8) + include(ProcessorCount) + ProcessorCount(NUM_BUILD_THREADS) ENDIF(NOT NUM_BUILD_THREADS) include (EnsureLLVMisPresent) From 02a4008a0434478f5d52e15d850eb3d3dada742c Mon Sep 17 00:00:00 2001 From: Paul Fultz II Date: Thu, 22 Sep 2016 00:30:45 -0500 Subject: [PATCH 2/2] Run tests on all cores --- tests/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4c9e6aa1558..18c2b757b67 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -78,8 +78,11 @@ if(POLICY CMP0037) cmake_policy(SET CMP0037 OLD) endif() +include(ProcessorCount) +ProcessorCount(N) + add_custom_target(test - COMMAND python ${LLVM_ROOT}/bin/llvm-lit -j 8 --path ${LLVM_TOOLS_DIR} -sv ${CMAKE_CURRENT_BINARY_DIR} + COMMAND python ${LLVM_ROOT}/bin/llvm-lit -j ${N} --path ${LLVM_TOOLS_DIR} -sv ${CMAKE_CURRENT_BINARY_DIR} # DEPENDS ${CPPAMP_GTEST_LIB} COMMENT "Running HCC regression tests")