Created
March 31, 2014 08:44
-
-
Save jbuda/9888066 to your computer and use it in GitHub Desktop.
Compiling 32/64 bit for devices and simulators for Objective-C and XCode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# folder vars | |
FOLDERNAME=${PROJECT_NAME} | |
LIBRARYNAME="lib${PROJECT_NAME}.a" | |
OUTPUTFOLDER=${SRCROOT}/build/${FOLDERNAME} | |
# make sure the output directory exists | |
mkdir -p "${OUTPUTFOLDER}" | |
# device / simulator builds | |
xcodebuild -project "${PROJECT_NAME}.xcodeproj" -configuration "Release" -sdk "iphoneos7.1" clean build ARCHS="armv7 armv7s" IPHONEOS_DEPLOYMENT_TARGET="5.0" TARGET_BUILD_DIR="${BUILD_DIR}/build-arm" BUILT_PRODUCTS_DIR="${BUILD_DIR}/build-arm" | |
xcodebuild -project "${PROJECT_NAME}.xcodeproj" -configuration "Release" -sdk "iphoneos7.1" clean build ARCHS="arm64" IPHONEOS_DEPLOYMENT_TARGET="7.0" TARGET_BUILD_DIR="${BUILD_DIR}/build-arm64" BUILT_PRODUCTS_DIR="${BUILD_DIR}/build-arm64" | |
xcodebuild -project "${PROJECT_NAME}.xcodeproj" -configuration "Release" -sdk "iphonesimulator7.0" clean build ARCHS="i386" IPHONEOS_DEPLOYMENT_TARGET="5.0" TARGET_BUILD_DIR="${BUILD_DIR}/build-i386" BUILT_PRODUCTS_DIR="${BUILD_DIR}/build-i386" | |
xcodebuild -project "${PROJECT_NAME}.xcodeproj" -configuration "Release" -sdk "iphonesimulator7.0" clean build ARCHS="x86_64" VALID_ARCHS="x86_64" IPHONEOS_DEPLOYMENT_TARGET="7.0" TARGET_BUILD_DIR="${BUILD_DIR}/build-x86_64" BUILT_PRODUCTS_DIR="${BUILD_DIR}/build-x86_64" | |
# create universal library | |
lipo -create "${BUILD_DIR}/build-arm/${LIBRARYNAME}" "${BUILD_DIR}/build-arm64/${LIBRARYNAME}" "${BUILD_DIR}/build-i386/${LIBRARYNAME}" "${BUILD_DIR}/build-x86_64/${LIBRARYNAME}" -output "${OUTPUTFOLDER}/${LIBRARYNAME}" | |
# copy the header files | |
cp -R "${BUILD_DIR}/build-arm/include" "${OUTPUTFOLDER}/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment