@@ -59,6 +59,7 @@ DO_COPYSDK=0
59
59
OPT_LEGACY_ARCH=0
60
60
OPT_USE_BITCODE=0
61
61
OPT_WEAK_TVOS=0
62
+ OPT_INCLUDE_DSYMS=0
62
63
63
64
# -----------------------------------------------------------------------------
64
65
# USAGE prints help and exits the script with error code from provided parameter
@@ -81,6 +82,7 @@ function USAGE
81
82
echo " -nc | --no-clean disable 'clean' before 'build'"
82
83
echo " also disables temporary data cleanup after build"
83
84
echo " --optional-tvos tvOS is not required when SDK is not installed"
85
+ echo " --include-dsyms include debug symbols into final xcframework"
84
86
echo " -v0 turn off all prints to stdout"
85
87
echo " -v1 print only basic log about build progress"
86
88
echo " -v2 print full build log with rich debug info"
@@ -347,8 +349,14 @@ function BUILD_COMMAND
347
349
348
350
# Add produced platform framework to the list
349
351
local FINAL_FW=" ${ARCHIVE_PATH} /Products/Library/Frameworks/${OUT_FW} .framework"
352
+ local FINAL_DSYM=" ${ARCHIVE_PATH} /dSYMs/${OUT_FW} .framework.dSYM"
350
353
[[ ! -d " ${FINAL_FW} " ]] && FAILURE " Xcode build did not produce '${OUT_FW} .framework' for platform ${PLATFORM} "
351
354
ALL_FAT_LIBS+=(" ${FINAL_FW} " )
355
+ ALL_XCFW_ARGS+=" -framework ${FINAL_FW} "
356
+ if [ x$OPT_INCLUDE_DSYMS == x1 ]; then
357
+ [[ ! -d " ${FINAL_DSYM} " ]] && FAILURE " Xcode build did not produce dSYMs for '${OUT_FW} .framework' for platform ${PLATFORM} "
358
+ ALL_XCFW_ARGS+=" -debug-symbols ${FINAL_DSYM} "
359
+ fi
352
360
}
353
361
354
362
# -----------------------------------------------------------------------------
@@ -377,6 +385,7 @@ function BUILD_LIB
377
385
PREPARE_OPENSSL
378
386
379
387
ALL_FAT_LIBS=()
388
+ ALL_XCFW_ARGS=
380
389
381
390
BUILD_PATCH_ARCHITECTURES
382
391
@@ -390,14 +399,12 @@ function BUILD_LIB
390
399
LOG_LINE
391
400
LOG " Creating final ${OUT_FW} .xcframework..."
392
401
local XCFW_PATH=" ${OUT_DIR} /${OUT_FW} .xcframework"
393
- local XCFW_ARGS=
394
402
for ARG in ${ALL_FAT_LIBS[@]} ; do
395
- XCFW_ARGS+=" -framework ${ARG} "
396
403
DEBUG_LOG " - source fw: ${ARG} "
397
404
done
398
405
DEBUG_LOG " - target fw: ${XCFW_PATH} "
399
406
400
- xcodebuild -create-xcframework $XCFW_ARGS -output " ${XCFW_PATH} "
407
+ xcodebuild -create-xcframework $ALL_XCFW_ARGS -output " ${XCFW_PATH} "
401
408
}
402
409
403
410
# -----------------------------------------------------------------------------
527
534
--optional-tvos)
528
535
OPT_WEAK_TVOS=1
529
536
;;
537
+ --include-dsyms)
538
+ OPT_INCLUDE_DSYMS=1
539
+ ;;
530
540
--legacy-archs)
531
541
OPT_LEGACY_ARCH=1
532
542
;;
0 commit comments