[compiler-rt] r227509 - [compiler-rt] OS X: Update the CMake and Make builds to explicitely use libc++, mmacosx-version-min and SDKs

Kuba Brecka kuba.brecka at gmail.com
Wed Feb 11 05:32:54 PST 2015


Hi Justin,
how about an even simpler solution:  Using “/“ as the SDK root when `xcrun` returns an empty string:

Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 228816)
+++ CMakeLists.txt	(working copy)
@@ -295,6 +295,9 @@
   string(REGEX MATCH "-mmacosx-version-min="
          MACOSX_VERSION_MIN_FLAG "${CMAKE_CXX_FLAGS}")
   set(SANITIZER_COMMON_SUPPORTED_DARWIN_OS osx)
+  if (NOT OSX_SDK_DIR) # Probably a Command Line Tools setup
+    set(OSX_SDK_DIR "/")
+  endif()
   if (IOSSIM_SDK_DIR AND NOT MACOSX_VERSION_MIN_FLAG)
     list(APPEND SANITIZER_COMMON_SUPPORTED_DARWIN_OS iossim)
   endif()

Will this work?  Can you test this for me?

Thanks,
Kuba

> On Feb 3, 2015, at 10:17 PM, Justin Bogner <mail at justinbogner.com> wrote:
> 
> Kuba Brecka <kuba.brecka at gmail.com> writes:
>> But the Command Line Tools do contain the SDK, right? What is the
>> command to get the path to it then?
> 
> I think the simplest thing to do is to not provide a -isysroot if we
> don't find an SDK for OSX. On a system without Xcode an empty string is
> returned from `xcrun --sdk macosx --show-sdk-path`, whereas on a system
> with Xcode the result matches `xcodebuild -version -sdk macosx Path`.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150211/a36238fa/attachment.html>


More information about the llvm-commits mailing list