[PATCH] D34736: [cmake] Cache results of find_darwin_sdk_dir

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 6 18:06:48 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL307344: [cmake] Cache results of find_darwin_sdk_dir (authored by kuba.brecka).

Changed prior to commit:
  https://reviews.llvm.org/D34736?vs=105561&id=105570#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D34736

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,6 +4,11 @@
 # 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 @@
   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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34736.105570.patch
Type: text/x-patch
Size: 1197 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170707/9c1c7990/attachment.bin>


More information about the llvm-commits mailing list