diff options
author | Brad King <brad.king@kitware.com> | 2019-10-03 17:34:42 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-10-03 18:55:22 (GMT) |
commit | 83c1657ff7fda3dc86b49bc9039f59449f2d8ae4 (patch) | |
tree | aa13cfff76c4134309428293f6e69aed364febac /Source/cmLocalGenerator.cxx | |
parent | d918b4a545fefd1593753189d83ec8590f430579 (diff) | |
download | CMake-83c1657ff7fda3dc86b49bc9039f59449f2d8ae4.zip CMake-83c1657ff7fda3dc86b49bc9039f59449f2d8ae4.tar.gz CMake-83c1657ff7fda3dc86b49bc9039f59449f2d8ae4.tar.bz2 |
Unity build: Generate sources during Compute step
The unity build sources need to be added for all generators. Create
them during `cmGlobalGenerator::Compute` to avoid duplicating the calls
in every generator. We already handle Qt autogen there too.
Issue: #19789
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 154d509..fc1426d 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -2437,13 +2437,18 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target, } } -void cmLocalGenerator::AddUnityBuild(cmGeneratorTarget* target, - const std::string& config) +void cmLocalGenerator::AddUnityBuild(cmGeneratorTarget* target) { if (!target->GetPropertyAsBool("UNITY_BUILD")) { return; } + // FIXME: Handle all configurations in multi-config generators. + std::string config; + if (!this->GetGlobalGenerator()->IsMultiConfig()) { + config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); + } + const std::string buildType = cmSystemTools::UpperCase(config); std::string filename_base = |