diff options
author | Brad King <brad.king@kitware.com> | 2020-01-16 15:33:41 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-01-16 15:33:48 (GMT) |
commit | 05738b5f21c95c83dbd25bfb4e8bfc1be5be713a (patch) | |
tree | 49c619949293cd44d75883d196692dc6f820e3d1 | |
parent | c0ac53b90c170e781b085e219dae6cc03cccdfd3 (diff) | |
parent | 97c124e30f530f64fafdc2b3a9decd1bf31bcf9c (diff) | |
download | CMake-05738b5f21c95c83dbd25bfb4e8bfc1be5be713a.zip CMake-05738b5f21c95c83dbd25bfb4e8bfc1be5be713a.tar.gz CMake-05738b5f21c95c83dbd25bfb4e8bfc1be5be713a.tar.bz2 |
Merge topic 'pch_job_pool'
97c124e30f Ninja: Add a separate job pool for PCH creation
ebd0b16ddb vim: Add target_precompile_headers command highlighting
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Cristian Adam <cristian.adam@gmail.com>
Merge-request: !4224
-rw-r--r-- | Auxiliary/vim/syntax/cmake.vim | 9 | ||||
-rw-r--r-- | Help/manual/cmake-properties.7.rst | 1 | ||||
-rw-r--r-- | Help/manual/cmake-variables.7.rst | 1 | ||||
-rw-r--r-- | Help/prop_tgt/JOB_POOL_PRECOMPILE_HEADER.rst | 21 | ||||
-rw-r--r-- | Help/variable/CMAKE_JOB_POOL_PRECOMPILE_HEADER.rst | 6 | ||||
-rw-r--r-- | Modules/Platform/Windows-PGI.cmake | 3 | ||||
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 7 | ||||
-rw-r--r-- | Source/cmTarget.cxx | 1 |
8 files changed, 48 insertions, 1 deletions
diff --git a/Auxiliary/vim/syntax/cmake.vim b/Auxiliary/vim/syntax/cmake.vim index 31ec1d0..0676f7e 100644 --- a/Auxiliary/vim/syntax/cmake.vim +++ b/Auxiliary/vim/syntax/cmake.vim @@ -221,6 +221,7 @@ syn keyword cmakeProperty contained \ JOB_POOLS \ JOB_POOL_COMPILE \ JOB_POOL_LINK + \ JOB_POOL_PRECOMPILE_HEADER \ KEEP_EXTENSION \ LABELS \ LANGUAGE @@ -1066,6 +1067,7 @@ syn keyword cmakeVariable contained \ CMAKE_JOB_POOLS \ CMAKE_JOB_POOL_COMPILE \ CMAKE_JOB_POOL_LINK + \ CMAKE_JOB_POOL_PRECOMPILE_HEADER \ CMAKE_Java \ CMAKE_Java_ANDROID_TOOLCHAIN_MACHINE \ CMAKE_Java_ANDROID_TOOLCHAIN_PREFIX @@ -2864,6 +2866,11 @@ syn keyword cmakeKWtarget_link_options contained \ _LINKER_WRAPPER_FLAG \ _LINKER_WRAPPER_FLAG_SEP +syn keyword cmakeKWtarget_precompile_headers contained + \ INTERFACE + \ PRIVATE + \ PUBLIC + syn keyword cmakeKWtarget_sources contained \ ALIAS \ IMPORTED @@ -3168,6 +3175,7 @@ syn keyword cmakeCommand \ target_link_directories \ target_link_libraries \ target_link_options + \ target_precompile_headers \ target_sources \ try_compile \ try_run @@ -3324,6 +3332,7 @@ hi def link cmakeKWtarget_include_directories ModeMsg hi def link cmakeKWtarget_link_directories ModeMsg hi def link cmakeKWtarget_link_libraries ModeMsg hi def link cmakeKWtarget_link_options ModeMsg +hi def link cmakeKWtarget_precompile_headers ModeMsg hi def link cmakeKWtarget_sources ModeMsg hi def link cmakeKWtry_compile ModeMsg hi def link cmakeKWtry_run ModeMsg diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index b3802d1..393735e 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -253,6 +253,7 @@ Properties on Targets /prop_tgt/IOS_INSTALL_COMBINED /prop_tgt/JOB_POOL_COMPILE /prop_tgt/JOB_POOL_LINK + /prop_tgt/JOB_POOL_PRECOMPILE_HEADER /prop_tgt/LABELS /prop_tgt/LANG_CLANG_TIDY /prop_tgt/LANG_COMPILER_LAUNCHER diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index 26f1d80..0f7d2ec 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -65,6 +65,7 @@ Variables that Provide Information /variable/CMAKE_IMPORT_LIBRARY_SUFFIX /variable/CMAKE_JOB_POOL_COMPILE /variable/CMAKE_JOB_POOL_LINK + /variable/CMAKE_JOB_POOL_PRECOMPILE_HEADER /variable/CMAKE_JOB_POOLS /variable/CMAKE_LANG_COMPILER_AR /variable/CMAKE_LANG_COMPILER_RANLIB diff --git a/Help/prop_tgt/JOB_POOL_PRECOMPILE_HEADER.rst b/Help/prop_tgt/JOB_POOL_PRECOMPILE_HEADER.rst new file mode 100644 index 0000000..ece28a4 --- /dev/null +++ b/Help/prop_tgt/JOB_POOL_PRECOMPILE_HEADER.rst @@ -0,0 +1,21 @@ +JOB_POOL_PRECOMPILE_HEADER +-------------------------- + +Ninja only: Pool used for generating pre-compiled headers. + +The number of parallel compile processes could be limited by defining +pools with the global :prop_gbl:`JOB_POOLS` +property and then specifying here the pool name. + +For instance: + +.. code-block:: cmake + + set_property(TARGET myexe PROPERTY JOB_POOL_PRECOMPILE_HEADER two_jobs) + +This property is initialized by the value of +:variable:`CMAKE_JOB_POOL_PRECOMPILE_HEADER`. + +If neither :prop_tgt:`JOB_POOL_PRECOMPILE_HEADER` nor +:variable:`CMAKE_JOB_POOL_PRECOMPILE_HEADER` are set then +:prop_tgt:`JOB_POOL_COMPILE` will be used for this task. diff --git a/Help/variable/CMAKE_JOB_POOL_PRECOMPILE_HEADER.rst b/Help/variable/CMAKE_JOB_POOL_PRECOMPILE_HEADER.rst new file mode 100644 index 0000000..f9467b3 --- /dev/null +++ b/Help/variable/CMAKE_JOB_POOL_PRECOMPILE_HEADER.rst @@ -0,0 +1,6 @@ +CMAKE_JOB_POOL_PRECOMPILE_HEADER +-------------------------------- + +This variable is used to initialize the :prop_tgt:`JOB_POOL_PRECOMPILE_HEADER` +property on all the targets. See :prop_tgt:`JOB_POOL_PRECOMPILE_HEADER` +for additional information. diff --git a/Modules/Platform/Windows-PGI.cmake b/Modules/Platform/Windows-PGI.cmake index ad77e8a..8166240 100644 --- a/Modules/Platform/Windows-PGI.cmake +++ b/Modules/Platform/Windows-PGI.cmake @@ -9,9 +9,10 @@ endif() set(__WINDOWS_COMPILER_PGI 1) # PGI on Windows doesn't support parallel compile processes -if(NOT DEFINED CMAKE_JOB_POOL_LINK OR NOT DEFINED CMAKE_JOB_POOL_COMPILE) +if(NOT DEFINED CMAKE_JOB_POOL_LINK OR NOT DEFINED CMAKE_JOB_POOL_COMPILE OR NOT DEFINED CMAKE_JOB_POOL_PRECOMPILE_HEADER) set(CMAKE_JOB_POOL_LINK PGITaskPool) set(CMAKE_JOB_POOL_COMPILE PGITaskPool) + set(CMAKE_JOB_POOL_PRECOMPILE_HEADER PGITaskPool) get_property(_pgijp GLOBAL PROPERTY JOB_POOLS) if(NOT _pgijp MATCHES "PGITaskPool=") set_property(GLOBAL APPEND PROPERTY JOB_POOLS PGITaskPool=1) diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index bd19b28..5a8c144 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -1196,6 +1196,13 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( this->addPoolNinjaVariable("JOB_POOL_COMPILE", this->GetGeneratorTarget(), vars); + if (!pchSource.empty() && !source->GetProperty("SKIP_PRECOMPILE_HEADERS")) { + if (source->GetFullPath() == pchSource) { + this->addPoolNinjaVariable("JOB_POOL_PRECOMPILE_HEADER", + this->GetGeneratorTarget(), vars); + } + } + this->SetMsvcTargetPdbVariable(vars, config); objBuild.RspFile = objectFileName + ".rsp"; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 6590629..ae1393f 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -513,6 +513,7 @@ cmTarget::cmTarget(std::string const& name, cmStateEnums::TargetType type, this->GetType() != cmStateEnums::UTILITY) { initProp("JOB_POOL_COMPILE"); initProp("JOB_POOL_LINK"); + initProp("JOB_POOL_PRECOMPILE_HEADER"); } if (impl->TargetType <= cmStateEnums::UTILITY) { |