diff options
author | Kuba Mracek <mracek@apple.com> | 2017-07-07 01:06:20 +0000 |
---|---|---|
committer | Kuba Mracek <mracek@apple.com> | 2017-07-07 01:06:20 +0000 |
commit | 32840b9046e67dcf45fb0b14b44c0ec226858cc3 (patch) | |
tree | 77a21126ddf858b8125ee150438b0f0784f8cbe7 /cmake | |
parent | 55b271fd886d0140311c28421fae978e0c19de28 (diff) |
[cmake] Cache results of find_darwin_sdk_dir
This improves find_darwin_sdk_dir to cache the results of executing xcodebuild to find the SDK. Should significantly reduce the CMake re-configure time.
Differential Revision: https://reviews.llvm.org/D34736
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@307344 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/Modules/CompilerRTDarwinUtils.cmake | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/cmake/Modules/CompilerRTDarwinUtils.cmake b/cmake/Modules/CompilerRTDarwinUtils.cmake index 18379080c..aaa97e33e 100644 --- a/cmake/Modules/CompilerRTDarwinUtils.cmake +++ b/cmake/Modules/CompilerRTDarwinUtils.cmake @@ -4,6 +4,11 @@ include(CMakeParseArguments) # 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) + set(DARWIN_${sdk_name}_CACHED_SYSROOT "" CACHE STRING "Darwin SDK path for SDK ${sdk_name}.") + if(DARWIN_${sdk_name}_CACHED_SYSROOT) + set(${var} ${DARWIN_${sdk_name}_CACHED_SYSROOT} PARENT_SCOPE) + return() + endif() 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. @@ -29,6 +34,7 @@ function(find_darwin_sdk_dir var sdk_name) if(result_process EQUAL 0) set(${var} ${var_internal} PARENT_SCOPE) endif() + set(DARWIN_${sdk_name}_CACHED_SYSROOT ${var_internal} CACHE STRING "Darwin SDK path for SDK ${sdk_name}." FORCE) endfunction() # There isn't a clear mapping of what architectures are supported with a given |