aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2020-11-28 21:32:58 -0600
committerluigi1111 <luigi1111w@gmail.com>2020-11-28 21:32:58 -0600
commit55a39f8e67fb71d637571726da3f23af52668d11 (patch)
tree67b950645d0ebb4284ae76578413b57006a7ec43
parentMerge pull request #7007 (diff)
parentcmake: Use job pool feature to limit concurrent jobs (diff)
downloadmonero-55a39f8e67fb71d637571726da3f23af52668d11.tar.xz
Merge pull request #6747
12a78e5 cmake: Use job pool feature to limit concurrent jobs (00-matt)
-rw-r--r--CMakeLists.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 316fd7ed8..0920b34f3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -55,6 +55,20 @@ else()
message(STATUS "ccache deselected")
endif()
+if (${CMAKE_VERSION} VERSION_GREATER "3.0.0" AND CMAKE_MAKE_PROGRAM MATCHES "ninja")
+ set(MONERO_PARALLEL_COMPILE_JOBS "" CACHE STRING "The maximum number of concurrent compilation jobs.")
+ if (MONERO_PARALLEL_COMPILE_JOBS)
+ set_property(GLOBAL APPEND PROPERTY JOB_POOLS compile_job_pool=${MONERO_PARALLEL_COMPILE_JOBS})
+ set(CMAKE_JOB_POOL_COMPILE compile_job_pool)
+ endif ()
+
+ set(MONERO_PARALLEL_LINK_JOBS "" CACHE STRING "The maximum number of concurrent link jobs.")
+ if (MONERO_PARALLEL_LINK_JOBS)
+ set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=${MONERO_PARALLEL_LINK_JOBS})
+ set(CMAKE_JOB_POOL_LINK link_job_pool)
+ endif ()
+endif()
+
enable_language(C ASM)
function (die msg)