[compiler-rt] 52beec7 - Fix compiler-rt build on macOS without XCode

Alex Richardson via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 31 14:19:44 PDT 2019


Author: Alex Richardson
Date: 2019-10-31T21:17:24Z
New Revision: 52beec76de83934b9be4448deb3a509b224e4a7e

URL: https://github.com/llvm/llvm-project/commit/52beec76de83934b9be4448deb3a509b224e4a7e
DIFF: https://github.com/llvm/llvm-project/commit/52beec76de83934b9be4448deb3a509b224e4a7e.diff

LOG: Fix compiler-rt build on macOS without XCode

Summary:
Starting with 8a5bfbe6db2824642bf9a1d27a24c5b6132b244f (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

Added: 
    

Modified: 
    compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake

Removed: 
    


################################################################################
diff  --git a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
index 4667cc004823..96a5526c073c 100644
--- a/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
+++ b/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -49,7 +49,7 @@ function(find_darwin_sdk_version var sdk_name)
   if(NOT DARWIN_PREFER_PUBLIC_SDK)
     # Let's first try the internal SDK, otherwise use the public SDK.
     execute_process(
-      COMMAND xcodebuild -version -sdk ${sdk_name}.internal SDKVersion
+      COMMAND xcrun --sdk ${sdk_name}.internal --show-sdk-version
       RESULT_VARIABLE result_process
       OUTPUT_VARIABLE var_internal
       OUTPUT_STRIP_TRAILING_WHITESPACE
@@ -58,7 +58,7 @@ function(find_darwin_sdk_version var sdk_name)
   endif()
   if((NOT ${result_process} EQUAL 0) OR "" STREQUAL "${var_internal}")
     execute_process(
-      COMMAND xcodebuild -version -sdk ${sdk_name} SDKVersion
+      COMMAND xcrun --sdk ${sdk_name} --show-sdk-version
       RESULT_VARIABLE result_process
       OUTPUT_VARIABLE var_internal
       OUTPUT_STRIP_TRAILING_WHITESPACE


        


More information about the llvm-commits mailing list