[ios][build] Generate debug symbols for all builds

Fixes the issue where our stripped dynamic build did not have a valid dSYM.

Disabling GCC_GENERATE_DEBUGGING_SYMBOLS for SYMBOLS=NO builds meant
that those builds had no debug symbols to strip or add to a dSYM.
This commit is contained in:
Jason Wray
2016-09-29 18:35:07 -04:00
parent c64a0c2486
commit 5cacbb4505
2 changed files with 6 additions and 8 deletions

View File

@@ -51,7 +51,7 @@ You can customize the build output by passing the following arguments into the `
* `BUILDTYPE=Release` will optimize for distribution. Defaults to `Debug`.
* `BUILD_DEVICE=false` builds only for the iOS Simulator.
* `FORMAT=dynamic` builds only a dynamic framework. `FORMAT=static` builds only a static framework, for compatibility with iOS 7.x.
* `SYMBOLS=NO` strips the build output of any debug symbols, yielding much smaller binaries.
* `SYMBOLS=NO` strips the build output of any debug symbols, yielding much smaller binaries. Defaults to `YES`.
An example command that creates a dynamic framework suitable for eventual App Store distribution:

View File

@@ -11,7 +11,7 @@ PRODUCTS=${DERIVED_DATA}/Build/Products
BUILDTYPE=${BUILDTYPE:-Debug}
BUILD_FOR_DEVICE=${BUILD_DEVICE:-true}
GCC_GENERATE_DEBUGGING_SYMBOLS=${SYMBOLS:-YES}
SYMBOLS=${SYMBOLS:-YES}
BUILD_DYNAMIC=true
BUILD_STATIC=true
@@ -42,7 +42,7 @@ if [[ ${BUILD_FOR_DEVICE} == true ]]; then
fi
IOS_SDK_VERSION=`xcrun --sdk ${SDK} --show-sdk-version`
echo "Configuring ${FORMAT:-dynamic and static} ${BUILDTYPE} framework for ${SDK}; symbols: ${GCC_GENERATE_DEBUGGING_SYMBOLS}; self-contained static framework: ${SELF_CONTAINED:-NO}"
echo "Configuring ${FORMAT:-dynamic and static} ${BUILDTYPE} framework for ${SDK}; symbols: ${SYMBOLS}; self-contained static framework: ${SELF_CONTAINED:-NO}"
function step { >&2 echo -e "\033[1m\033[36m* $@\033[0m"; }
function finish { >&2 echo -en "\033[0m"; }
@@ -79,7 +79,6 @@ elif [[ ${BUILD_STATIC} == true ]]; then
fi
xcodebuild \
GCC_GENERATE_DEBUGGING_SYMBOLS=${GCC_GENERATE_DEBUGGING_SYMBOLS} \
CURRENT_PROJECT_VERSION=${PROJ_VERSION} \
CURRENT_SHORT_VERSION=${SHORT_VERSION} \
CURRENT_SEMANTIC_VERSION=${SEM_VERSION} \
@@ -94,7 +93,6 @@ xcodebuild \
if [[ ${BUILD_FOR_DEVICE} == true ]]; then
xcodebuild \
GCC_GENERATE_DEBUGGING_SYMBOLS=${GCC_GENERATE_DEBUGGING_SYMBOLS} \
CURRENT_PROJECT_VERSION=${PROJ_VERSION} \
CURRENT_SHORT_VERSION=${SHORT_VERSION} \
CURRENT_SEMANTIC_VERSION=${SEM_VERSION} \
@@ -111,7 +109,7 @@ fi
LIBS=(Mapbox.a mbgl-core.a mbgl-platform-ios.a)
# https://medium.com/@syshen/create-an-ios-universal-framework-148eb130a46c
if [[ "${BUILD_FOR_DEVICE}" == true ]]; then
if [[ ${BUILD_FOR_DEVICE} == true ]]; then
if [[ ${BUILD_STATIC} == true ]]; then
step "Assembling static framework for iOS Simulator and devices…"
mkdir -p ${OUTPUT}/static/${NAME}.framework
@@ -168,8 +166,8 @@ else
cp -rv ${PRODUCTS}/${BUILDTYPE}-iphonesimulator/Settings.bundle ${STATIC_SETTINGS_DIR}
fi
if [[ "${GCC_GENERATE_DEBUGGING_SYMBOLS}" == false ]]; then
step "Stripping binaries…"
if [[ ${SYMBOLS} = NO ]]; then
step "Stripping symbols from binaries…"
if [[ ${BUILD_STATIC} == true ]]; then
strip -Sx "${OUTPUT}/static/${NAME}.framework/${NAME}"
fi