Skip to content

Commit d25407c

Browse files
authored
Make build_ios pass empty sysroot when building device and simulator (#299)
* Make build_ios pass empty sysroot when building device and simulator * Update build_ios.sh
1 parent ad5ffd1 commit d25407c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

build_ios.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ if [[ " ${platforms[@]} " =~ " simulator " ]]; then
137137
if [ "$osx_sysroot" == "" ]; then
138138
osx_sysroot=${SIMULATOR_OSX_SYSROOT}
139139
else
140-
osx_sysroot="${osx_sysroot};${SIMULATOR_OSX_SYSROOT}"
140+
# We want this to be empty when building for both
141+
osx_sysroot=""
141142
fi
142143
if [ "$xcode_platforms" == "" ]; then
143144
xcode_platforms="-${SIMULATOR_OSX_SYSROOT}"
@@ -193,11 +194,14 @@ mkdir -p "$buildpath"
193194

194195
pushd "$buildpath"
195196

197+
if [ "$osx_sysroot" != "" ]; then
198+
CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_OSX_SYSROOT=$osx_sysroot"
199+
fi
200+
196201
# Configure cmake with option value
197202
cmake $sourcepath \
198203
-DCMAKE_TOOLCHAIN_FILE=$sourcepath/cmake/unity_ios.cmake \
199204
-DCMAKE_OSX_ARCHITECTURES=$cmake_archs \
200-
-DCMAKE_OSX_SYSROOT=$osx_sysroot \
201205
-DCMAKE_XCODE_EFFECTIVE_PLATFORMS=$xcode_platforms \
202206
-DIOS_PLATFORM_LOCATION=$ios_location \
203207
-DUNITY_ROOT_DIR=${UNITY_ROOT_DIR} \

0 commit comments

Comments
 (0)