summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-03-30 15:08:10 (GMT)
committerBrad King <brad.king@kitware.com>2020-03-30 15:24:27 (GMT)
commit5a95b5e091fa2a2d0ad869a80c37eaa980917853 (patch)
treebc820a43004c4ea7ef90ee5c53ace0f587a72af2 /Source
parentb7d8c91822101ff9de07075e9b1f02e18c2725da (diff)
downloadCMake-5a95b5e091fa2a2d0ad869a80c37eaa980917853.zip
CMake-5a95b5e091fa2a2d0ad869a80c37eaa980917853.tar.gz
CMake-5a95b5e091fa2a2d0ad869a80c37eaa980917853.tar.bz2
target_link_libraries: Fix regression in case of $<CONFIG> genex
Since commit b8626261e9 (Precompile headers: Add methods to generate PCH sources, 2019-07-13, v3.16.0-rc1~182^2~4) we look up source files for a target using an upper-case configuration even though an original-case name is sufficient. Since commit 36ded610af (PCH: Generate sources during Compute step, 2019-10-05, v3.16.0-rc1~2^2) the source file lookup is the first time we compute many on-demand structures that depend on the configuration name. This caused the `$<CONFIG>` generator expression to evaluate to the upper-case configuration name in some cases where we used original-case before. Fix this by switching the source file lookup to the original-case config name. Add a test covering the symptom that led to the discovery of this problem. Fixes: #20517
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalGenerator.cxx7
1 files changed, 2 insertions, 5 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index ffd46d4..af92e1b 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2306,11 +2306,10 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
if (!this->GetGlobalGenerator()->IsMultiConfig()) {
config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
}
- const std::string buildType = cmSystemTools::UpperCase(config);
// FIXME: Refactor collection of sources to not evaluate object libraries.
std::vector<cmSourceFile*> sources;
- target->GetSourceFiles(sources, buildType);
+ target->GetSourceFiles(sources, config);
for (const std::string& lang : { "C", "CXX", "OBJC", "OBJCXX" }) {
auto langSources =
@@ -2481,15 +2480,13 @@ void cmLocalGenerator::AddUnityBuild(cmGeneratorTarget* target)
config = this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
}
- const std::string buildType = cmSystemTools::UpperCase(config);
-
std::string filename_base =
cmStrCat(this->GetCurrentBinaryDirectory(), "/CMakeFiles/",
target->GetName(), ".dir/Unity/");
// FIXME: Refactor collection of sources to not evaluate object libraries.
std::vector<cmSourceFile*> sources;
- target->GetSourceFiles(sources, buildType);
+ target->GetSourceFiles(sources, config);
auto batchSizeString = target->GetProperty("UNITY_BUILD_BATCH_SIZE");
const size_t unityBatchSize =