@@ -1755,14 +1755,8 @@ function(add_swift_target_library name)
1755
1755
list (APPEND swiftlib_link_flags_all "-Wl,-z,defs" )
1756
1756
endif ()
1757
1757
# Setting back linker flags which are not supported when making Android build on macOS cross-compile host.
1758
- if (SWIFTLIB_SHARED)
1759
- if (sdk IN_LIST SWIFT_APPLE_PLATFORMS)
1760
- list (APPEND swiftlib_link_flags_all "-dynamiclib -Wl,-headerpad_max_install_names" )
1761
- elseif (${sdk} STREQUAL ANDROID)
1762
- list (APPEND swiftlib_link_flags_all "-shared" )
1763
- # TODO: Instead of `lib${name}.so` find variable or target property which already have this value.
1764
- list (APPEND swiftlib_link_flags_all "-Wl,-soname,lib${name} .so" )
1765
- endif ()
1758
+ if (SWIFTLIB_SHARED AND sdk IN_LIST SWIFT_APPLE_PLATFORMS)
1759
+ list (APPEND swiftlib_link_flags_all "-dynamiclib -Wl,-headerpad_max_install_names" )
1766
1760
endif ()
1767
1761
1768
1762
set (sdk_supported_archs
@@ -1903,6 +1897,13 @@ function(add_swift_target_library name)
1903
1897
1904
1898
list (APPEND swiftlib_c_compile_flags_all "-DSWIFT_TARGET_LIBRARY_NAME=${name} " )
1905
1899
1900
+ # Setting back linker flags which are not supported when making Android build on macOS cross-compile host.
1901
+ if (SWIFTLIB_SHARED AND ${sdk} STREQUAL ANDROID)
1902
+ list (APPEND swiftlib_link_flags_all "-shared" )
1903
+ # TODO: Instead of `lib${name}.so` find variable or target property which already have this value.
1904
+ list (APPEND swiftlib_link_flags_all "-Wl,-soname,lib${name} .so" )
1905
+ endif ()
1906
+
1906
1907
# Add this library variant.
1907
1908
_add_swift_target_library_single(
1908
1909
${variant_name}
0 commit comments