llvm.org GIT mirror llvm / d2206e4
[CMake] Move ninja job pool options to HandleLLVMOptions Moving the Ninja job pool configuration settings into the HandleLLVMOptions module will allow standalone builds of LLVM sub-projects to use the LLVM options without needing to re-implement them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294334 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Bieneman 3 years ago
2 changed file(s) with 24 addition(s) and 23 deletion(s). Raw diff Collapse all Expand all
130130 set(LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../clang-tools-extra")
131131 endif()
132132 endforeach()
133
134 # The following only works with the Ninja generator in CMake >= 3.0.
135 set(LLVM_PARALLEL_COMPILE_JOBS "" CACHE STRING
136 "Define the maximum number of concurrent compilation jobs.")
137 if(LLVM_PARALLEL_COMPILE_JOBS)
138 if(NOT CMAKE_MAKE_PROGRAM MATCHES "ninja")
139 message(WARNING "Job pooling is only available with Ninja generators.")
140 else()
141 set_property(GLOBAL APPEND PROPERTY JOB_POOLS compile_job_pool=${LLVM_PARALLEL_COMPILE_JOBS})
142 set(CMAKE_JOB_POOL_COMPILE compile_job_pool)
143 endif()
144 endif()
145133
146134 # Build llvm with ccache if the package is present
147135 set(LLVM_CCACHE_BUILD OFF CACHE BOOL "Set to ON for a ccache enabled build")
180168 option(LLVM_BUILD_GLOBAL_ISEL "Experimental: Build GlobalISel" ON)
181169 if(LLVM_BUILD_GLOBAL_ISEL)
182170 add_definitions(-DLLVM_BUILD_GLOBAL_ISEL)
183 endif()
184
185 set(LLVM_PARALLEL_LINK_JOBS "" CACHE STRING
186 "Define the maximum number of concurrent link jobs.")
187 if(LLVM_PARALLEL_LINK_JOBS)
188 if(NOT CMAKE_MAKE_PROGRAM MATCHES "ninja")
189 message(WARNING "Job pooling is only available with Ninja generators.")
190 else()
191 set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=${LLVM_PARALLEL_LINK_JOBS})
192 set(CMAKE_JOB_POOL_LINK link_job_pool)
193 endif()
194171 endif()
195172
196173 # Add path for custom modules
1010 include(AddLLVMDefinitions)
1111 include(CheckCCompilerFlag)
1212 include(CheckCXXCompilerFlag)
13
14 # Ninja Job Pool support
15 # The following only works with the Ninja generator in CMake >= 3.0.
16 set(LLVM_PARALLEL_COMPILE_JOBS "" CACHE STRING
17 "Define the maximum number of concurrent compilation jobs.")
18 if(LLVM_PARALLEL_COMPILE_JOBS)
19 if(NOT CMAKE_MAKE_PROGRAM MATCHES "ninja")
20 message(WARNING "Job pooling is only available with Ninja generators.")
21 else()
22 set_property(GLOBAL APPEND PROPERTY JOB_POOLS compile_job_pool=${LLVM_PARALLEL_COMPILE_JOBS})
23 set(CMAKE_JOB_POOL_COMPILE compile_job_pool)
24 endif()
25 endif()
26
27 set(LLVM_PARALLEL_LINK_JOBS "" CACHE STRING
28 "Define the maximum number of concurrent link jobs.")
29 if(LLVM_PARALLEL_LINK_JOBS)
30 if(NOT CMAKE_MAKE_PROGRAM MATCHES "ninja")
31 message(WARNING "Job pooling is only available with Ninja generators.")
32 else()
33 set_property(GLOBAL APPEND PROPERTY JOB_POOLS link_job_pool=${LLVM_PARALLEL_LINK_JOBS})
34 set(CMAKE_JOB_POOL_LINK link_job_pool)
35 endif()
36 endif()
1337
1438
1539 if (CMAKE_LINKER MATCHES "lld-link.exe")