diff options
author | Brad King <brad.king@kitware.com> | 2020-07-17 08:24:57 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-07-17 08:26:40 -0400 |
commit | 14a571244758ac6851c3a36e69f92388458c2ea0 (patch) | |
tree | 58dc1f0ad5cdae4b018e0729366f7161bb96f523 /Source | |
parent | d421274e3e11a0e6480358faa8a8e5cf48d7b3c2 (diff) | |
download | cmake-14a571244758ac6851c3a36e69f92388458c2ea0.tar.gz |
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.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index f2011ee665..c7baf2b713 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 }; |