diff --git a/port/iOS/IPHONEOS_ARM64_TOOLCHAIN.cmake b/port/iOS/IPHONEOS_ARM64_TOOLCHAIN.cmake index 89da24f09..e37045cf4 100644 --- a/port/iOS/IPHONEOS_ARM64_TOOLCHAIN.cmake +++ b/port/iOS/IPHONEOS_ARM64_TOOLCHAIN.cmake @@ -5,16 +5,9 @@ SET (CMAKE_SYSTEM_NAME "Darwin") SET (CMAKE_SYSTEM_PROCESSOR "arm64") SET (IOS TRUE) -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release") -endif() - SET (CC "${DEVROOT}/usr/bin/clang") SET (CXX "${DEVROOT}/usr/bin/clang++") -CMAKE_FORCE_C_COMPILER (${CC} LLVM) -CMAKE_FORCE_CXX_COMPILER (${CXX} LLVM) - set(CMAKE_CXX_FLAGS "-Wall -Wextra") set(CMAKE_CXX_FLAGS_DEBUG "-g") set(CMAKE_CXX_FLAGS_RELEASE "-O3") diff --git a/port/iOS/IPHONEOS_ARMV6_TOOLCHAIN.cmake b/port/iOS/IPHONEOS_ARMV6_TOOLCHAIN.cmake index 686b2faab..47ac79481 100644 --- a/port/iOS/IPHONEOS_ARMV6_TOOLCHAIN.cmake +++ b/port/iOS/IPHONEOS_ARMV6_TOOLCHAIN.cmake @@ -5,16 +5,9 @@ SET (CMAKE_SYSTEM_NAME "Darwin") SET (CMAKE_SYSTEM_PROCESSOR "armv6") SET (IOS TRUE) -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release") -endif() - SET (CC "${DEVROOT}/usr/bin/clang") SET (CXX "${DEVROOT}/usr/bin/clang++") -CMAKE_FORCE_C_COMPILER (${CC} LLVM) -CMAKE_FORCE_CXX_COMPILER (${CXX} LLVM) - set(CMAKE_CXX_FLAGS "-Wall -Wextra") set(CMAKE_CXX_FLAGS_DEBUG "-g") set(CMAKE_CXX_FLAGS_RELEASE "-O3") diff --git a/port/iOS/IPHONEOS_ARMV7S_TOOLCHAIN.cmake b/port/iOS/IPHONEOS_ARMV7S_TOOLCHAIN.cmake index f34aad1fe..44f58e091 100644 --- a/port/iOS/IPHONEOS_ARMV7S_TOOLCHAIN.cmake +++ b/port/iOS/IPHONEOS_ARMV7S_TOOLCHAIN.cmake @@ -5,16 +5,9 @@ SET (CMAKE_SYSTEM_NAME "Darwin") SET (CMAKE_SYSTEM_PROCESSOR "armv7s") SET (IOS TRUE) -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release") -endif() - SET (CC "${DEVROOT}/usr/bin/clang") SET (CXX "${DEVROOT}/usr/bin/clang++") -CMAKE_FORCE_C_COMPILER (${CC} LLVM) -CMAKE_FORCE_CXX_COMPILER (${CXX} LLVM) - set(CMAKE_CXX_FLAGS "-Wall -Wextra") set(CMAKE_CXX_FLAGS_DEBUG "-g") set(CMAKE_CXX_FLAGS_RELEASE "-O3") diff --git a/port/iOS/IPHONEOS_ARMV7_TOOLCHAIN.cmake b/port/iOS/IPHONEOS_ARMV7_TOOLCHAIN.cmake index 46a0afbea..f8e5e8657 100644 --- a/port/iOS/IPHONEOS_ARMV7_TOOLCHAIN.cmake +++ b/port/iOS/IPHONEOS_ARMV7_TOOLCHAIN.cmake @@ -5,16 +5,9 @@ SET (CMAKE_SYSTEM_NAME "Darwin") SET (CMAKE_SYSTEM_PROCESSOR "armv7") SET (IOS TRUE) -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release") -endif() - SET (CC "${DEVROOT}/usr/bin/clang") SET (CXX "${DEVROOT}/usr/bin/clang++") -CMAKE_FORCE_C_COMPILER (${CC} LLVM) -CMAKE_FORCE_CXX_COMPILER (${CXX} LLVM) - set(CMAKE_CXX_FLAGS "-Wall -Wextra") set(CMAKE_CXX_FLAGS_DEBUG "-g") set(CMAKE_CXX_FLAGS_RELEASE "-O3") diff --git a/port/iOS/IPHONEOS_I386_TOOLCHAIN.cmake b/port/iOS/IPHONEOS_I386_TOOLCHAIN.cmake index 919817851..4b161f33a 100644 --- a/port/iOS/IPHONEOS_I386_TOOLCHAIN.cmake +++ b/port/iOS/IPHONEOS_I386_TOOLCHAIN.cmake @@ -5,16 +5,9 @@ SET (CMAKE_SYSTEM_NAME "Darwin") SET (CMAKE_SYSTEM_PROCESSOR "i386") SET (IOS TRUE) -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release") -endif() - SET (CC "${DEVROOT}/usr/bin/clang") SET (CXX "${DEVROOT}/usr/bin/clang++") -CMAKE_FORCE_C_COMPILER (${CC} LLVM) -CMAKE_FORCE_CXX_COMPILER (${CXX} LLVM) - set(CMAKE_CXX_FLAGS "-Wall -Wextra") set(CMAKE_CXX_FLAGS_DEBUG "-g") set(CMAKE_CXX_FLAGS_RELEASE "-O3") diff --git a/port/iOS/IPHONEOS_X86_64_TOOLCHAIN.cmake b/port/iOS/IPHONEOS_X86_64_TOOLCHAIN.cmake index a9514ddaa..07c103174 100644 --- a/port/iOS/IPHONEOS_X86_64_TOOLCHAIN.cmake +++ b/port/iOS/IPHONEOS_X86_64_TOOLCHAIN.cmake @@ -5,16 +5,9 @@ SET (CMAKE_SYSTEM_NAME "Darwin") SET (CMAKE_SYSTEM_PROCESSOR "x86_64") SET (IOS TRUE) -if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release") -endif() - SET (CC "${DEVROOT}/usr/bin/clang") SET (CXX "${DEVROOT}/usr/bin/clang++") -CMAKE_FORCE_C_COMPILER (${CC} LLVM) -CMAKE_FORCE_CXX_COMPILER (${CXX} LLVM) - set(CMAKE_CXX_FLAGS "-Wall -Wextra") set(CMAKE_CXX_FLAGS_DEBUG "-g") set(CMAKE_CXX_FLAGS_RELEASE "-O3") diff --git a/port/iOS/build.sh b/port/iOS/build.sh index 338526632..2bb88014b 100755 --- a/port/iOS/build.sh +++ b/port/iOS/build.sh @@ -12,21 +12,25 @@ BUILD_DIR="./lib/iOS" IOS_SDK_VERSION=$(xcodebuild -version -sdk iphoneos | grep SDKVersion | cut -f2 -d ':' | tr -d '[[:space:]]') ################################### +################################### +# BUILD Configuration +################################### + BUILD_SHARED_LIBS=OFF -BUILD_TYPE=Release +BUILD_TYPE=Debug ################################################ # Minimum iOS deployment target version ################################################ -MIN_IOS_VERSION="8.0" +MIN_IOS_VERSION="6.0" IOS_SDK_TARGET=$MIN_IOS_VERSION XCODE_ROOT_DIR=$(xcode-select --print-path) TOOLCHAIN=$XCODE_ROOT_DIR/Toolchains/XcodeDefault.xctoolchain -BUILD_ARCHS_DEVICE="arm64 armv7" +BUILD_ARCHS_DEVICE="arm64 armv7s armv7" BUILD_ARCHS_SIMULATOR="x86_64 i386" -BUILD_ARCHS_ALL=(armv7 arm64 x86_64 i386) +BUILD_ARCHS_ALL=(armv7 armv7s arm64 x86_64 i386) CPP_DEV_TARGET_LIST=(miphoneos-version-min mios-simulator-version-min) CPP_DEV_TARGET= @@ -62,7 +66,7 @@ build_arch() rm CMakeCache.txt - cmake -G 'Unix Makefiles' -DCMAKE_TOOLCHAIN_FILE=./port/iOS/IPHONEOS_$(echo $1 | tr '[:lower:]' '[:upper:]')_TOOLCHAIN.cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS + cmake -G 'Unix Makefiles' -DCMAKE_TOOLCHAIN_FILE=./port/iOS/IPHONEOS_$(echo $1 | tr '[:lower:]' '[:upper:]')_TOOLCHAIN.cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DENABLE_BOOST_WORKAROUND=ON -DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS echo "[!] Building $1 library" @@ -102,12 +106,22 @@ for i in "$@"; do DEPLOY_ARCHS=`echo $i | sed 's/[-a-zA-Z0-9]*=//'` echo "[!] Selecting architectures: $DEPLOY_ARCHS" ;; + -r=*|--release=*) + BUILD_TYPE=Release + echo "[!] Selecting build type: Release" + ;; + -s=*|--shared-lib=*) + BUILD_SHARED_LIBS=ON + echo "[!] Will generate dynamic libraries" + ;; -n|--no-fat) DEPLOY_FAT=0 echo "[!] Fat binary will not be created." ;; -h|--help) echo " - don't build fat library (--no-fat)." + echo " - don't include debug information and apply compiler optimizations (--release)." + echo " - generate dynamic libraries rather than static ones (--shared-lib)." echo " - supported architectures (--archs): $(echo $(join , ${BUILD_ARCHS_ALL[*]}) | sed 's/,/, /g')" echo " - supported C++ STD libs (--stdlib): $(echo $(join , ${CPP_STD_LIB_LIST[*]}) | sed 's/,/, /g')" echo " - supported C++ standards (--std): $(echo $(join , ${CPP_STD_LIST[*]}) | sed 's/,/, /g')"