summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2021-01-22 13:47:27 (GMT)
committerCristian Adam <cristian.adam@gmail.com>2021-02-02 18:11:44 (GMT)
commit9f060971411aca979807f70307d8b9fe1b43ff24 (patch)
tree9ab20661fc4f3efd21476d9a8dba89ef23bdc19b /Source/cmLocalGenerator.cxx
parent9b96fbc358aba8110ba09d3ad2262223ec0f0167 (diff)
downloadCMake-9f060971411aca979807f70307d8b9fe1b43ff24.zip
CMake-9f060971411aca979807f70307d8b9fe1b43ff24.tar.gz
CMake-9f060971411aca979807f70307d8b9fe1b43ff24.tar.bz2
PCH: Remove restrictions for REUSE_FROM signature for MSVC
Fixes: #20201
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx23
1 files changed, 16 insertions, 7 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 349b53b..3111911 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2610,16 +2610,25 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
}
}
- if (reuseTarget->GetType() != cmStateEnums::OBJECT_LIBRARY) {
- std::string pchSourceObj =
- reuseTarget->GetPchFileObject(config, lang, arch);
-
- // Link to the pch object file
+ // Link to the pch object file
+ std::string pchSourceObj =
+ reuseTarget->GetPchFileObject(config, lang, arch);
+
+ if (target->GetType() != cmStateEnums::OBJECT_LIBRARY) {
+ std::string linkerProperty = "LINK_FLAGS_";
+ if (target->GetType() == cmStateEnums::STATIC_LIBRARY) {
+ linkerProperty = "STATIC_LIBRARY_FLAGS_";
+ }
target->Target->AppendProperty(
- cmStrCat("LINK_FLAGS_", configUpper),
+ cmStrCat(linkerProperty, configUpper),
cmStrCat(" ",
this->ConvertToOutputFormat(pchSourceObj, SHELL)),
true);
+ } else {
+ target->Target->AppendProperty(
+ "INTERFACE_LINK_LIBRARIES",
+ cmStrCat("$<$<CONFIG:", config,
+ ">:$<LINK_ONLY:", pchSourceObj, ">>"));
}
}
} else {
@@ -2738,7 +2747,7 @@ void cmLocalGenerator::CopyPchCompilePdb(
this->AddCustomCommandToTarget(
target->GetName(), outputs, no_deps, commandLines,
cmCustomCommandType::PRE_BUILD, no_message, no_current_dir, true, false,
- "", "", false, cmObjectLibraryCommands::Reject, stdPipesUTF8);
+ "", "", false, cmObjectLibraryCommands::Accept, stdPipesUTF8);
} else {
cmImplicitDependsList no_implicit_depends;
cmSourceFile* copy_rule = this->AddCustomCommandToOutput(