Skip to content

Commit 6ea5db1

Browse files
authored
Update ios.toolchain.cmake
Added fix if upgrading Xcode versions on consequent builds
1 parent a6f55e8 commit 6ea5db1

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

ios.toolchain.cmake

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,20 +182,22 @@ endif()
182182
message(STATUS "Configuring iOS build for platform: ${IOS_PLATFORM}, "
183183
"architecture(s): ${IOS_ARCH}")
184184
# If user did not specify the SDK root to use, then query xcodebuild for it.
185-
if (NOT CMAKE_OSX_SYSROOT)
185+
if (NOT EXISTS ${CMAKE_OSX_SYSROOT})
186186
execute_process(COMMAND xcodebuild -version -sdk ${XCODE_IOS_PLATFORM} Path
187187
OUTPUT_VARIABLE CMAKE_OSX_SYSROOT
188188
ERROR_QUIET
189189
OUTPUT_STRIP_TRAILING_WHITESPACE)
190-
message(STATUS "Using SDK: ${CMAKE_OSX_SYSROOT} for platform: ${IOS_PLATFORM}")
191-
endif()
192-
if (NOT EXISTS ${CMAKE_OSX_SYSROOT})
193-
message(SEND_ERROR "Please make sure that Xcode is installed and that the toolchain"
194-
"is pointing to the correct path. Please run:"
195-
"sudo xcode-select -s /Applications/Xcode.app/Contents/Developer"
196-
"and see if that fixes the problem for you.")
197-
message(FATAL_ERROR "Invalid CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT} "
198-
"does not exist.")
190+
191+
if (NOT EXISTS ${CMAKE_OSX_SYSROOT})
192+
message(SEND_ERROR "Please make sure that Xcode is installed and that the toolchain"
193+
"is pointing to the correct path. Please run:"
194+
"sudo xcode-select -s /Applications/Xcode.app/Contents/Developer"
195+
"and see if that fixes the problem for you.")
196+
message(FATAL_ERROR "Invalid CMAKE_OSX_SYSROOT: ${CMAKE_OSX_SYSROOT} "
197+
"does not exist.")
198+
else()
199+
message(STATUS "Using SDK: ${CMAKE_OSX_SYSROOT} for platform: ${IOS_PLATFORM}")
200+
endif()
199201
endif()
200202
# Specify minimum version of deployment target.
201203
if (NOT DEFINED IOS_DEPLOYMENT_TARGET)

0 commit comments

Comments
 (0)