From 856f5f1dcc1c9df47848e1b6d29028bb050c5092 Mon Sep 17 00:00:00 2001 From: Yauheni Khnykin Date: Wed, 21 Feb 2024 18:01:26 +0100 Subject: [PATCH] Fixes compilation of framework when its Swift uses symbols from another linked one Signed-off-by: Yauheni Khnykin --- CHANGELOG.md | 4 ++++ cmake/modules/gluecodium/swift/TargetLinkFrameworks.cmake | 5 +++++ .../lime/main_bar.lime | 7 +++++++ 3 files changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39a0785f16..ef9a26d610 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Gluecodium project Release Notes +## Unpublished: +### Bug fixes: + * Bridging headers from linked frameworks are used. It solves problem with some cases, for example when interface inherts (extends) another one in lime. + ## 13.8.1 Release date: 2024-02-07 ### Bug fixes: diff --git a/cmake/modules/gluecodium/swift/TargetLinkFrameworks.cmake b/cmake/modules/gluecodium/swift/TargetLinkFrameworks.cmake index 724d0bb93c..28b93ea5af 100644 --- a/cmake/modules/gluecodium/swift/TargetLinkFrameworks.cmake +++ b/cmake/modules/gluecodium/swift/TargetLinkFrameworks.cmake @@ -126,6 +126,11 @@ function(_gluecodium_target_link_framework target_dst target_framework) set_property( TARGET ${target_dst} APPEND_STRING PROPERTY XCODE_ATTRIBUTE_OTHER_SWIFT_FLAGS " -framework ${_framework_name} -F${framework_dir} ") + + # In some cases bridging headers from dependencies are necessary. For example when one interface + # inherits (i.e. extends) another. + get_target_property(_bridging_headers ${target_framework} GLUECODIUM_BRIDGING_HEADERS) + set_property(TARGET ${_target} APPEND PROPERTY GLUECODIUM_BRIDGING_HEADERS "${_bridging_headers}") endfunction() function(_gluecodium_find_common_target_in_framework result target_framework) diff --git a/cmake/tests/unit/gluecodium_target_link_frameworks/dependent-frameworks-with-shared-modules-dependent-on-object-libs/lime/main_bar.lime b/cmake/tests/unit/gluecodium_target_link_frameworks/dependent-frameworks-with-shared-modules-dependent-on-object-libs/lime/main_bar.lime index 9bf18c4484..1827695846 100644 --- a/cmake/tests/unit/gluecodium_target_link_frameworks/dependent-frameworks-with-shared-modules-dependent-on-object-libs/lime/main_bar.lime +++ b/cmake/tests/unit/gluecodium_target_link_frameworks/dependent-frameworks-with-shared-modules-dependent-on-object-libs/lime/main_bar.lime @@ -24,8 +24,15 @@ class MainBar { constructor make(foo: CommonMainFoo) } +interface MainExtendBaseInterface: CommonMainBase { + fun extended_fun() +} + class MainDerived : unit.test.CommonMainBase { property id: Long { get } } + +class MainDerivedExtendednInterface: MainExtendBaseInterface { +}