[PATCH] D35071: [cmake] Add an option to prefer public SDK in find_darwin_sdk_dir
Phabricator via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 6 16:09:41 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL307330: [cmake] Add an option to prefer public SDK in find_darwin_sdk_dir (authored by kuba.brecka).
Changed prior to commit:
https://reviews.llvm.org/D35071?vs=105465&id=105560#toc
Repository:
rL LLVM
https://reviews.llvm.org/D35071
Files:
compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake
Index: compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake
===================================================================
--- compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake
+++ compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake
@@ -4,14 +4,17 @@
# set the default Xcode to use. This function finds the SDKs that are present in
# the current Xcode.
function(find_darwin_sdk_dir var sdk_name)
- # 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
- )
+ set(DARWIN_PREFER_PUBLIC_SDK OFF CACHE BOOL "Prefer Darwin public SDK, even when an internal SDK is present.")
+ 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 Path
+ RESULT_VARIABLE result_process
+ OUTPUT_VARIABLE var_internal
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ ERROR_FILE /dev/null
+ )
+ endif()
if((NOT result_process EQUAL 0) OR "" STREQUAL "${var_internal}")
execute_process(
COMMAND xcodebuild -version -sdk ${sdk_name} Path
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35071.105560.patch
Type: text/x-patch
Size: 1338 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170706/c744a61f/attachment.bin>
More information about the llvm-commits
mailing list