11project (casablanca-ios NONE)
2- cmake_minimum_required (VERSION 2.6 )
2+ cmake_minimum_required (VERSION 3.1 )
33
44enable_testing ()
55
66if (CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET)
77 set (ENV{CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET} ${CMAKE_XCODE_ATTRIBUTE_IPHONEOS_DEPLOYMENT_TARGET} )
88endif ()
99
10- set (TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR} /iOS.cmake" )
11-
12- set (SIM_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR} /build.i386" CACHE INTERNAL "" )
13- set (SIM_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR} /../Release" CACHE INTERNAL "" )
10+ set (TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR} /ios-cmake/ios.toolchain.cmake" )
1411
1512set (SIM64_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR} /build.x86_64" CACHE INTERNAL "" )
1613set (SIM64_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR} /../Release" CACHE INTERNAL "" )
1714
18- set (ARM_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR} /build.arm " CACHE INTERNAL "" )
19- set (ARM_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR} /../Release" CACHE INTERNAL "" )
15+ set (ARM64_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR} /build.arm64 " CACHE INTERNAL "" )
16+ set (ARM64_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR} /../Release" CACHE INTERNAL "" )
2017add_test (NAME ios_runner
2118 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} /../Release/tests/common/testrunner/ios
2219 COMMAND xcodebuild test -project ios_runner.xcodeproj -configuration =${CMAKE_BUILD_TYPE} -scheme ios_runner -destination "platform=iOS Simulator,name=iPhone 6" LIBRARY_SEARCH_PATH=${SIM_BINARY_DIR}
2320 )
2421
25- file (MAKE_DIRECTORY ${SIM_BINARY_DIR} )
26- execute_process (WORKING_DIRECTORY ${SIM_BINARY_DIR}
27- COMMAND ${CMAKE_COMMAND}
28- -GXcode
29- -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}
30- -DIOS_PLATFORM=SIMULATOR
31- -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
32- -DCMAKE_C_COMPILER=${CLANG_C_COMPILER}
33- -DCMAKE_CXX_COMPILER=${CLANG_CXX_COMPILER}
34- "${SIM_SOURCE_DIR} "
35- )
36-
3722file (MAKE_DIRECTORY ${SIM64_BINARY_DIR} )
3823execute_process (WORKING_DIRECTORY ${SIM64_BINARY_DIR}
3924 COMMAND ${CMAKE_COMMAND}
4025 -GXcode
4126 -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}
4227 -DIOS_PLATFORM=SIMULATOR64
4328 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
44- -DCMAKE_C_COMPILER=${CLANG_C_COMPILER}
45- -DCMAKE_CXX_COMPILER=${CLANG_CXX_COMPILER}
4629 "${SIM64_SOURCE_DIR} "
4730)
4831
49- file (MAKE_DIRECTORY ${ARM_BINARY_DIR } )
50- execute_process (WORKING_DIRECTORY ${ARM_BINARY_DIR }
32+ file (MAKE_DIRECTORY ${ARM64_BINARY_DIR } )
33+ execute_process (WORKING_DIRECTORY ${ARM64_BINARY_DIR }
5134 COMMAND ${CMAKE_COMMAND}
5235 -GXcode
5336 -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}
54- -DIOS_PLATFORM=OS
37+ -DIOS_PLATFORM=OS64
5538 -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
56- -DCMAKE_C_COMPILER=${CLANG_C_COMPILER}
57- -DCMAKE_CXX_COMPILER=${CLANG_CXX_COMPILER}
58- "${ARM_SOURCE_DIR} "
39+ "${ARM64_SOURCE_DIR} "
5940 )
6041
6142
62- ## Simulator i386 version
63- add_custom_target (sim
64- COMMAND ${CMAKE_COMMAND}
65- --build ${SIM_BINARY_DIR}
66- --config ${CMAKE_BUILD_TYPE}
67- COMMENT "Building for i386 (simulator)"
68- VERBATIM
69- )
70-
7143## Simulator x86_64 version
7244add_custom_target (sim64
7345 COMMAND ${CMAKE_COMMAND}
@@ -77,12 +49,12 @@ add_custom_target(sim64
7749VERBATIM
7850)
7951
80- ## ARM version
81- add_custom_target (arm
52+ ## ARM64 version
53+ add_custom_target (arm64
8254 COMMAND ${CMAKE_COMMAND}
83- --build ${ARM_BINARY_DIR }
55+ --build ${ARM64_BINARY_DIR }
8456 --config ${CMAKE_BUILD_TYPE}
85- COMMENT "Building for armv7, armv7s, arm64"
57+ COMMENT "Building for arm64"
8658 VERBATIM
8759)
8860
@@ -91,16 +63,13 @@ add_custom_command(
9163 OUTPUT ${LIB_CPPREST}
9264 COMMAND lipo -create
9365 -output "${CMAKE_CURRENT_BINARY_DIR} /${LIB_CPPREST} "
94- ${SIM_BINARY_DIR} /Binaries/${CMAKE_BUILD_TYPE} /${LIB_CPPREST}
9566 ${SIM64_BINARY_DIR} /Binaries/${CMAKE_BUILD_TYPE} /${LIB_CPPREST}
96- ${ARM_BINARY_DIR } /Binaries/${CMAKE_BUILD_TYPE} /${LIB_CPPREST}
67+ ${ARM64_BINARY_DIR } /Binaries/${CMAKE_BUILD_TYPE} /${LIB_CPPREST}
9768 DEPENDS
98- sim
9969 sim64
100- arm
101- "${SIM_BINARY_DIR} /Binaries/${CMAKE_BUILD_TYPE} /${LIB_CPPREST} "
70+ arm64
10271 "${SIM64_BINARY_DIR} /Binaries/${CMAKE_BUILD_TYPE} /${LIB_CPPREST} "
103- "${ARM_BINARY_DIR } /Binaries/${CMAKE_BUILD_TYPE} /${LIB_CPPREST} "
72+ "${ARM64_BINARY_DIR } /Binaries/${CMAKE_BUILD_TYPE} /${LIB_CPPREST} "
10473 VERBATIM
10574)
10675
0 commit comments