summaryrefslogtreecommitdiff
path: root/Source/cmLocalGenerator.cxx
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@gmail.com>2021-09-14 16:49:16 +0200
committerBrad King <brad.king@kitware.com>2021-09-15 10:39:46 -0400
commit3b9e04accb46127b837bc93e90d32060c63349ee (patch)
tree46f73e39d0a91b1b7b84d4c4f42f0f86acb64939 /Source/cmLocalGenerator.cxx
parentc9a29ce55d7af9980e866a98a3c81b5f4edb89b0 (diff)
downloadcmake-3b9e04accb46127b837bc93e90d32060c63349ee.tar.gz
PCH: MSVC: Restrict OBJECT library INTERFACE_LINK_LIBRARIES usage
The pch object file could cause problems when the reused pch is passed through an OBJECT library, which would use INTERFACE_LINK_LIBRARIES to link the pch object file. Fixes: #22630
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 8be015e0c1..5042874c5e 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2654,7 +2654,8 @@ void cmLocalGenerator::AddPchDependencies(cmGeneratorTarget* target)
cmStrCat(" ",
this->ConvertToOutputFormat(pchSourceObj, SHELL)),
true);
- } else {
+ } else if (reuseTarget->GetType() ==
+ cmStateEnums::OBJECT_LIBRARY) {
target->Target->AppendProperty(
"INTERFACE_LINK_LIBRARIES",
cmStrCat("$<$<CONFIG:", config,