@@ -23,6 +23,7 @@ usage(){
2323 -s, source path default: .
2424 -p, framework platform default: ${SUPPORTED_PLATFORMS[@]}
2525 -a, framework architecture default: ${SUPPORTED_ARCHITECTURES[@]}
26+ -c, cmake extra default: " "
2627 example:
2728 build_scripts/ios/build.sh -b ios_build -s . -a arm64"
2829}
@@ -38,13 +39,14 @@ readonly SUPPORTED_ARCHITECTURES="arm64;armv7" #;x86_64;i386" only support devic
3839buildpath=" ios_unity"
3940sourcepath=" ."
4041platforms=(" ${SUPPORTED_PLATFORMS[@]} " )
42+ cmake_extra=" "
4143
4244# Enable utf8 output
4345export LANG=en_US.UTF-8
4446
4547# check options
4648IFS=' ,' # split options on ',' characters
47- while getopts " :b:s:a" opt; do
49+ while getopts " :b:s:a:c " opt; do
4850 case $opt in
4951 h)
5052 usage
@@ -80,6 +82,9 @@ while getopts ":b:s:a" opt; do
8082 fi
8183 done
8284 ;;
85+ c)
86+ cmake_extra=$OPTARG
87+ ;;
8388 * )
8489 echo " unknown parameter"
8590 exit 2
@@ -90,6 +95,7 @@ echo "*********************** Build Unity iOS SDK ******************************
9095echo " build path: ${buildpath} "
9196echo " source path: ${sourcepath} "
9297echo " build platforms: ${platforms[@]} "
98+ echo " cmake extras: ${cmake_extra} "
9399echo " ***************************************************************************"
94100sourcepath=$( cd ${sourcepath} && pwd) # full path
95101buildpath=$( mkdir -p ${buildpath} && cd ${buildpath} && pwd) # full path
@@ -126,7 +132,7 @@ mkdir -p "$buildpath"
126132pushd " $buildpath "
127133
128134 # Configure cmake with option value
129- cmake -DCMAKE_TOOLCHAIN_FILE=${sourcepath} /cmake/unity_ios.cmake -DCMAKE_OSX_ARCHITECTURES=$SUPPORTED_ARCHITECTURES .. ${CMAKE_OPTIONS}
135+ cmake .. -DCMAKE_TOOLCHAIN_FILE=${sourcepath} /cmake/unity_ios.cmake -DCMAKE_OSX_ARCHITECTURES=$SUPPORTED_ARCHITECTURES ${CMAKE_OPTIONS} ${cmake_extra }
130136 check_exit_code $?
131137
132138 # Build the SDK
0 commit comments