Skip to content

Commit 62d420c

Browse files
author
Cynthia Jiang
committed
add cmake extra to build script
1 parent 5abcb80 commit 62d420c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

build_ios.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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
3839
buildpath="ios_unity"
3940
sourcepath="."
4041
platforms=("${SUPPORTED_PLATFORMS[@]}")
42+
cmake_extra=""
4143

4244
# Enable utf8 output
4345
export LANG=en_US.UTF-8
4446

4547
# check options
4648
IFS=',' # 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 ******************************
9095
echo "build path: ${buildpath}"
9196
echo "source path: ${sourcepath}"
9297
echo "build platforms: ${platforms[@]}"
98+
echo "cmake extras: ${cmake_extra}"
9399
echo "***************************************************************************"
94100
sourcepath=$(cd ${sourcepath} && pwd) #full path
95101
buildpath=$(mkdir -p ${buildpath} && cd ${buildpath} && pwd) #full path
@@ -126,7 +132,7 @@ mkdir -p "$buildpath"
126132
pushd "$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

Comments
 (0)