summaryrefslogtreecommitdiffstats
path: root/llvm/CMakeLists.txt
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2014-11-19 10:30:02 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2014-11-19 10:30:02 +0000
commitf1c381738b7fd2cc97353e9344a523a53a8ce574 (patch)
tree63748f1e9ce60ba950b2c021e0d7a475c24ef407 /llvm/CMakeLists.txt
parent3ac3b251a96e1e99e3aebcf9d99da16682483f6f (diff)
downloadbcm5719-llvm-f1c381738b7fd2cc97353e9344a523a53a8ce574.tar.gz
bcm5719-llvm-f1c381738b7fd2cc97353e9344a523a53a8ce574.zip
Use ninja pools to limit the number of concurrent compile/link jobs.
This change makes use of the new "job pool" capability in cmake 3.0 with ninja generator to allow limiting the number of concurrent jobs of a certain type. llvm-svn: 222341
Diffstat (limited to 'llvm/CMakeLists.txt')
-rw-r--r--llvm/CMakeLists.txt15
1 files changed, 15 insertions, 0 deletions
diff --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index e3ddb267966..6691189b724 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -24,6 +24,21 @@ endif()
project(LLVM)
+# The following only works with the Ninja generator in CMake >= 3.0.
+set(LLVM_PARALLEL_COMPILE_JOBS "" CACHE STRING
+ "Define the maximum number of concurrent compilation jobs.")
+if(LLVM_PARALLEL_COMPILE_JOBS)
+ set_property(GLOBAL APPEND PROPERTY JOB_POOLS compile_job_pool=${LLVM_PARALLEL_COMPILE_JOBS})
+ set(CMAKE_JOB_POOL_COMPILE compile_job_pool)
+endif()
+
+set(LLVM_PARALLEL_LINK_JOBS "" CACHE STRING
+ "Define the maximum number of concurrent link jobs.")
+if(LLVM_PARALLEL_LINK_JOBS)
+ set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=${LLVM_PARALLEL_LINK_JOBS})
+ set(CMAKE_JOB_POOL_LINK link_job_pool)
+endif()
+
# Add path for custom modules
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
OpenPOWER on IntegriCloud