Browse Source

Merge topic 'swift-link-iface'

14a5712447 Swift: Fix regression in linking to interface libraries

Acked-by: Kitware Robot <[email protected]>
Merge-request: !5027
Brad King 5 years ago
parent
commit
beb78ada5e
2 changed files with 4 additions and 0 deletions
  1. 3 0
      Source/cmGeneratorTarget.cxx
  2. 1 0
      Tests/SwiftOnly/CMakeLists.txt

+ 3 - 0
Source/cmGeneratorTarget.cxx

@@ -1365,6 +1365,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 };

+ 1 - 0
Tests/SwiftOnly/CMakeLists.txt

@@ -35,3 +35,4 @@ target_link_libraries(N PUBLIC
 
 # Dummy to make sure generation works with such targets.
 add_library(SwiftIface INTERFACE)
+target_link_libraries(SwiftOnly PRIVATE SwiftIface)