[compiler-rt] r240356 - [CMake] Respect the value of -mmacosx-version-min flag.
Alexey Samsonov
vonosmas at gmail.com
Mon Jun 22 16:30:28 PDT 2015
Author: samsonov
Date: Mon Jun 22 18:30:28 2015
New Revision: 240356
URL: http://llvm.org/viewvc/llvm-project?rev=240356&view=rev
Log:
[CMake] Respect the value of -mmacosx-version-min flag.
Make sure that sanitizer runtimes target OS X version provided in
-mmacosx-version-min= flag. Enforce that it should be at least 10.7.
Modified:
compiler-rt/trunk/CMakeLists.txt
Modified: compiler-rt/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/CMakeLists.txt?rev=240356&r1=240355&r2=240356&view=diff
==============================================================================
--- compiler-rt/trunk/CMakeLists.txt (original)
+++ compiler-rt/trunk/CMakeLists.txt Mon Jun 22 18:30:28 2015
@@ -292,14 +292,21 @@ if(APPLE)
find_darwin_sdk_dir(OSX_SDK_DIR macosx)
find_darwin_sdk_dir(IOSSIM_SDK_DIR iphonesimulator)
- string(REGEX MATCH "-mmacosx-version-min="
- MACOSX_VERSION_MIN_FLAG "${CMAKE_CXX_FLAGS}")
set(SANITIZER_COMMON_SUPPORTED_OS osx)
- if (IOSSIM_SDK_DIR AND NOT MACOSX_VERSION_MIN_FLAG)
- list(APPEND SANITIZER_COMMON_SUPPORTED_OS iossim)
+ string(REGEX MATCH "-mmacosx-version-min=([.0-9]+)"
+ MACOSX_VERSION_MIN_FLAG "${CMAKE_CXX_FLAGS}")
+ if(MACOSX_VERSION_MIN_FLAG)
+ set(SANITIZER_MIN_OSX_VERSION "${CMAKE_MATCH_1}")
+ if(SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.7")
+ message(FATAL_ERROR "Too old OS X version: ${SANITIZER_MIN_OSX_VERSION}")
+ endif()
+ else()
+ set(SANITIZER_MIN_OSX_VERSION 10.7)
+ if(IOSSIM_SDK_DIR)
+ list(APPEND SANITIZER_COMMON_SUPPORTED_OS iossim)
+ endif()
endif()
- set(SANITIZER_MIN_OSX_VERSION 10.7)
set(CMAKE_OSX_DEPLOYMENT_TARGET "") # We're setting the flag manually below.
set(DARWIN_osx_CFLAGS -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}
-stdlib=libc++)
More information about the llvm-commits
mailing list