@@ -1324,14 +1324,8 @@ function(add_swift_target_library name)
1324
1324
list (APPEND swiftlib_link_flags_all "-Wl,-z,defs" )
1325
1325
endif ()
1326
1326
# Setting back linker flags which are not supported when making Android build on macOS cross-compile host.
1327
- if (SWIFTLIB_SHARED)
1328
- if (sdk IN_LIST SWIFT_APPLE_PLATFORMS)
1329
- list (APPEND swiftlib_link_flags_all "-dynamiclib -Wl,-headerpad_max_install_names" )
1330
- elseif (${sdk} STREQUAL ANDROID)
1331
- list (APPEND swiftlib_link_flags_all "-shared" )
1332
- # TODO: Instead of `lib${name}.so` find variable or target property which already have this value.
1333
- list (APPEND swiftlib_link_flags_all "-Wl,-soname,lib${name} .so" )
1334
- endif ()
1327
+ if (SWIFTLIB_SHARED AND sdk IN_LIST SWIFT_APPLE_PLATFORMS)
1328
+ list (APPEND swiftlib_link_flags_all "-dynamiclib -Wl,-headerpad_max_install_names" )
1335
1329
endif ()
1336
1330
1337
1331
set (sdk_supported_archs
@@ -1472,6 +1466,13 @@ function(add_swift_target_library name)
1472
1466
1473
1467
list (APPEND swiftlib_c_compile_flags_all "-DSWIFT_TARGET_LIBRARY_NAME=${name} " )
1474
1468
1469
+ # Setting back linker flags which are not supported when making Android build on macOS cross-compile host.
1470
+ if (SWIFTLIB_SHARED AND ${sdk} STREQUAL ANDROID)
1471
+ list (APPEND swiftlib_link_flags_all "-shared" )
1472
+ # TODO: Instead of `lib${name}.so` find variable or target property which already have this value.
1473
+ list (APPEND swiftlib_link_flags_all "-Wl,-soname,lib${name} .so" )
1474
+ endif ()
1475
+
1475
1476
# Add this library variant.
1476
1477
_add_swift_target_library_single(
1477
1478
${variant_name}
0 commit comments