Commit 1ea21d7c authored by Dominik Charousset's avatar Dominik Charousset

Merge branch 'araste-topic/ios-build-all' into develop

parents e889301d 6f59ebae
......@@ -193,6 +193,17 @@ if(MINGW)
else()
set(EXTRA_FLAGS "${EXTRA_FLAGS} -fPIC")
endif()
# iOS support
if(CAF_OSX_SYSROOT)
set(CMAKE_OSX_SYSROOT "${CAF_OSX_SYSROOT}")
endif()
if(CAF_IOS_DEPLOYMENT_TARGET)
if("${CAF_OSX_SYSROOT}" STREQUAL "iphonesimulator")
set(EXTRA_FLAGS "${EXTRA_FLAGS} -mios-simulator-version-min=${CAF_IOS_DEPLOYMENT_TARGET}")
else()
set(EXTRA_FLAGS "${EXTRA_FLAGS} -miphoneos-version-min=${CAF_IOS_DEPLOYMENT_TARGET}")
endif()
endif()
# check if the user provided CXXFLAGS, set defaults otherwise
if(CMAKE_CXX_FLAGS)
set(CMAKE_CXX_FLAGS_DEBUG "")
......
......@@ -79,6 +79,12 @@ Usage: $0 [OPTION]... [VAR=VALUE]...
Influential Environment Variables (only on first invocation):
CXX C++ compiler command
CXXFLAGS C++ compiler flags
iOS Build Options (should be used with XCode generator):
--sysroot=DIR set system root for Clang
- iphoneos: for iOS device
- iphonesimulator: for iOS simulator
--ios-min-ver=VERSION set the ios deployment target version
$benchmark_suite_options"
......@@ -227,6 +233,13 @@ while [ $# -ne 0 ]; do
--warnings-as-errors)
append_cache_entry CXX_WARNINGS_AS_ERROS BOOL yes
;;
--sysroot=*)
append_cache_entry CAF_OSX_SYSROOT PATH "$optarg"
;;
--ios-min-ver=*)
append_cache_entry CMAKE_OSX_ARCHITECTURES STRING "\$(ARCHS_STANDARD_32_64_BIT)"
append_cache_entry CAF_IOS_DEPLOYMENT_TARGET STRING "$optarg"
;;
--with-log-level=*)
level=`echo "$optarg" | tr '[:lower:]' '[:upper:]'`
case $level in
......
#!/bin/bash
set -e
# minimum iOS version
IOS_DEPLOYMENT_TARGET=${IOS_DEPLOYMENT_TARGET:-"6.0"}
# location of the repository root. should contain configure file
SRCROOT=$( cd "$( dirname "${BASH_SOURCE[0]}" )"/.. && pwd )
if [ ! -f "$SRCROOT/configure" ]; then
echo "$SRCROOT is not repository root." \
"check the $(basename ${BASH_SOURCE[0]}$0) file location."
exit 100
fi
IPHONEOS_BUILD_DIR=build-iphoneos
IPHONESIMULATOR_BUILD_DIR=build-iphonesimulator
PREFIX=${PREFIX:-"${SRCROOT}/dist-ios"}
cd $SRCROOT
# ios simulator
./configure --generator=Xcode --build-dir=${IPHONESIMULATOR_BUILD_DIR} \
--build-static-only --no-examples --no-unit-tests --sysroot=iphonesimulator \
--ios-min-ver=${IOS_DEPLOYMENT_TARGET} --prefix=${PREFIX}
xcodebuild -project ${IPHONESIMULATOR_BUILD_DIR}/caf.xcodeproj -target ALL_BUILD \
-configuration Debug
# install headers
xcodebuild -project ${IPHONESIMULATOR_BUILD_DIR}/caf.xcodeproj -target install \
-configuration Release
# iphone os
./configure --generator=Xcode --build-dir=${IPHONEOS_BUILD_DIR} \
--build-static-only --no-examples --no-unit-tests --sysroot=iphoneos \
--ios-min-ver=${IOS_DEPLOYMENT_TARGET} --prefix=${PREFIX}
xcodebuild -project ${IPHONEOS_BUILD_DIR}/caf.xcodeproj -target ALL_BUILD \
-configuration Debug
xcodebuild -project ${IPHONEOS_BUILD_DIR}/caf.xcodeproj -target ALL_BUILD \
-configuration Release
mkdir -p ${PREFIX}/lib/Debug
lipo -create \
${IPHONEOS_BUILD_DIR}/bin/Debug/libcaf_core_static.a \
${IPHONESIMULATOR_BUILD_DIR}/bin/Debug/libcaf_core_static.a \
-output ${PREFIX}/lib/Debug/libcaf_core_static.a
lipo -create \
${IPHONEOS_BUILD_DIR}/bin/Debug/libcaf_io_static.a \
${IPHONESIMULATOR_BUILD_DIR}/bin/Debug/libcaf_io_static.a \
-output ${PREFIX}/lib/Debug/libcaf_io_static.a
mkdir -p ${PREFIX}/lib/Release
lipo -create \
${IPHONEOS_BUILD_DIR}/bin/Release/libcaf_core_static.a \
${IPHONESIMULATOR_BUILD_DIR}/bin/Release/libcaf_core_static.a \
-output ${PREFIX}/lib/Release/libcaf_core_static.a
lipo -create \
${IPHONEOS_BUILD_DIR}/bin/Release/libcaf_io_static.a \
${IPHONESIMULATOR_BUILD_DIR}/bin/Release/libcaf_io_static.a \
-output ${PREFIX}/lib/Release/libcaf_io_static.a
rm -rf ${IPHONEOS_BUILD_DIR}
rm -rf ${IPHONESIMULATOR_BUILD_DIR}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment