summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-07-17 12:24:57 (GMT)
committerBrad King <brad.king@kitware.com>2020-07-17 12:26:40 (GMT)
commit14a571244758ac6851c3a36e69f92388458c2ea0 (patch)
tree58dc1f0ad5cdae4b018e0729366f7161bb96f523 /Source
parentd421274e3e11a0e6480358faa8a8e5cf48d7b3c2 (diff)
downloadCMake-14a571244758ac6851c3a36e69f92388458c2ea0.zip
CMake-14a571244758ac6851c3a36e69f92388458c2ea0.tar.gz
CMake-14a571244758ac6851c3a36e69f92388458c2ea0.tar.bz2
Swift: Fix regression in linking to interface libraries
Since commit 2026915f8f (Swift: Propagate Swift_MODULE_DIRECTORY as include directory, 2020-02-03, v3.18.0-rc1~547^2) we internally call `GetAllConfigCompileLanguages` on all directly linked targets without checking if they are interface libraries that don't compile at all. That violates an internal assumption and assertion. Fixes: #20977
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGeneratorTarget.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index f2011ee..c7baf2b 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -1309,6 +1309,9 @@ void AddSwiftImplicitIncludeDirectories(
for (const cmLinkImplItem& library : libraries->Libraries) {
if (const cmGeneratorTarget* dependency = library.Target) {
+ if (dependency->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ continue;
+ }
if (cm::contains(dependency->GetAllConfigCompileLanguages(),
"Swift")) {
EvaluatedTargetPropertyEntry entry{ library, library.Backtrace };