diff --git a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake --- a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake +++ b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake @@ -65,6 +65,16 @@ ERROR_FILE /dev/null ) endif() + # Finally, use xcrun in case XCode is not installed. + if((NOT ${result_process} EQUAL 0) OR "" STREQUAL "${var_internal}") + execute_process( + COMMAND xcrun --sdk ${sdk_name} --show-sdk-version + RESULT_VARIABLE result_process + OUTPUT_VARIABLE var_internal + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_FILE /dev/null + ) + endif() if(NOT result_process EQUAL 0) message(FATAL_ERROR "Failed to determine SDK version for \"${sdk_name}\" SDK")