[compiler-rt] r307344 - [cmake] Cache results of find_darwin_sdk_dir
Kuba Mracek via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 6 18:06:20 PDT 2017
Author: kuba.brecka
Date: Thu Jul 6 18:06:20 2017
New Revision: 307344
URL: http://llvm.org/viewvc/llvm-project?rev=307344&view=rev
Log:
[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
Modified:
compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake
Modified: compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake?rev=307344&r1=307343&r2=307344&view=diff
==============================================================================
--- compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake (original)
+++ compiler-rt/trunk/cmake/Modules/CompilerRTDarwinUtils.cmake Thu Jul 6 18:06:20 2017
@@ -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_nam
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
More information about the llvm-commits
mailing list