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

Justin Bogner mail at justinbogner.com
Mon Feb 16 09:25:42 PST 2015


Kuba Brecka <kuba.brecka at gmail.com> writes:
> 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?

This does work, but it seems a little silly to specify "-isysroot /" in
the build commands. If this is significantly easier than omitting the
argument completely in that case, then I guess it's fine.




More information about the llvm-commits mailing list