@@ -373,12 +373,15 @@ endfunction()
373
373
#
374
374
# Usage:
375
375
# _add_swift_lipo_target(
376
+ # sdk # The name of the SDK the target was created for.
377
+ # # Examples include "OSX", "IOS", "ANDROID", etc.
376
378
# target # The name of the target to create
377
379
# output # The file to be created by this target
378
380
# source_targets... # The source targets whose outputs will be
379
381
# # lipo'd into the output.
380
382
# )
381
- function (_add_swift_lipo_target target output )
383
+ function (_add_swift_lipo_target sdk target output )
384
+ precondition (sdk MESSAGE "sdk is required" )
382
385
precondition (target MESSAGE "target is required" )
383
386
precondition (output MESSAGE "output is required" )
384
387
@@ -397,7 +400,8 @@ function(_add_swift_lipo_target target output)
397
400
endif ()
398
401
endforeach ()
399
402
400
- if ("${CMAKE_SYSTEM_NAME} " STREQUAL "Darwin" )
403
+ is_darwin_based_sdk ("${sdk} " IS_DARWIN )
404
+ if (IS_DARWIN )
401
405
# Use lipo to create the final binary.
402
406
add_custom_command_target (unused_var
403
407
COMMAND "${LIPO} " "-create" "-output" "${output} " ${source_binaries}
@@ -1467,6 +1471,7 @@ function(add_swift_library name)
1467
1471
endif ()
1468
1472
1469
1473
_add_swift_lipo_target (
1474
+ ${sdk}
1470
1475
${lipo_target}${unsigned}
1471
1476
"${UNIVERSAL_LIBRARY_NAME}${unsigned} "
1472
1477
${THIN_INPUT_TARGETS} )
@@ -1529,6 +1534,7 @@ function(add_swift_library name)
1529
1534
set (UNIVERSAL_LIBRARY_NAME
1530
1535
"${SWIFTSTATICLIB_DIR} /${SWIFT_SDK_${sdk} _LIB_SUBDIR}/${CMAKE_STATIC_LIBRARY_PREFIX}${name}${CMAKE_STATIC_LIBRARY_SUFFIX} " )
1531
1536
_add_swift_lipo_target (
1537
+ ${sdk}
1532
1538
${lipo_target_static}
1533
1539
"${UNIVERSAL_LIBRARY_NAME} "
1534
1540
${THIN_INPUT_TARGETS_STATIC} )
0 commit comments