Skip to content

Commit 52beec7

Browse files
committed
Fix compiler-rt build on macOS without XCode
Summary: Starting with 8a5bfbe (D68292) this file unconditionally uses xcodebuild to get the SDK version. On my system this always fails with `xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance` Reviewers: delcypher, yln Reviewed By: delcypher, yln Subscribers: dberris, mgorny, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D69610
1 parent 54a873b commit 52beec7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function(find_darwin_sdk_version var sdk_name)
4949
if(NOT DARWIN_PREFER_PUBLIC_SDK)
5050
# Let's first try the internal SDK, otherwise use the public SDK.
5151
execute_process(
52-
COMMAND xcodebuild -version -sdk ${sdk_name}.internal SDKVersion
52+
COMMAND xcrun --sdk ${sdk_name}.internal --show-sdk-version
5353
RESULT_VARIABLE result_process
5454
OUTPUT_VARIABLE var_internal
5555
OUTPUT_STRIP_TRAILING_WHITESPACE
@@ -58,7 +58,7 @@ function(find_darwin_sdk_version var sdk_name)
5858
endif()
5959
if((NOT ${result_process} EQUAL 0) OR "" STREQUAL "${var_internal}")
6060
execute_process(
61-
COMMAND xcodebuild -version -sdk ${sdk_name} SDKVersion
61+
COMMAND xcrun --sdk ${sdk_name} --show-sdk-version
6262
RESULT_VARIABLE result_process
6363
OUTPUT_VARIABLE var_internal
6464
OUTPUT_STRIP_TRAILING_WHITESPACE

0 commit comments

Comments
 (0)