# Let's first try the internal SDK, otherwise use the public SDK.
execute_process(
COMMAND xcodebuild -version -sdk ${sdk_name}.internal Path
+ RESULT_VARIABLE result_process
OUTPUT_VARIABLE var_internal
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_FILE /dev/null
)
- if("" STREQUAL "${var_internal}")
+ if((NOT result_process EQUAL 0) OR "" STREQUAL "${var_internal}")
execute_process(
COMMAND xcodebuild -version -sdk ${sdk_name} Path
+ RESULT_VARIABLE result_process
OUTPUT_VARIABLE var_internal
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_FILE /dev/null
else()
set(${var}_INTERNAL ${var_internal} PARENT_SCOPE)
endif()
- set(${var} ${var_internal} PARENT_SCOPE)
+ if(result_process EQUAL 0)
+ set(${var} ${var_internal} PARENT_SCOPE)
+ endif()
endfunction()
# There isn't a clear mapping of what architectures are supported with a given
find_darwin_sdk_dir(DARWIN_tvossim_SYSROOT appletvsimulator)
find_darwin_sdk_dir(DARWIN_tvos_SYSROOT appletvos)
+ if(NOT DARWIN_osx_SYSROOT)
+ if(EXISTS /usr/include)
+ set(DARWIN_osx_SYSROOT /)
+ else()
+ message(ERROR "Could not detect OS X Sysroot. Either install Xcode or the Apple Command Line Tools")
+ endif()
+ endif()
+
if(COMPILER_RT_ENABLE_IOS)
list(APPEND DARWIN_EMBEDDED_PLATFORMS ios)
set(DARWIN_ios_MIN_VER_FLAG -miphoneos-version-min)