summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2015-06-25 20:43:35 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2015-06-25 20:43:35 +0000
commit366e7b9f26da422874aad1727a87f7356465b09d (patch)
treec6a77dfecf0efadd4cbeea0e58b454bbc2b74f5b
parentbb1b1c0c9a49ea22d68555f79cae95d01c9dcf99 (diff)
downloadcompiler-rt-366e7b9f26da422874aad1727a87f7356465b09d.tar.gz
[Sanitizer] Set minimum supported Mac OS X version to 10.9, if it wasn't specified explicitly.
-fsanitize=vptr is a UBSan feature that doesn't work on older Mac OS X versions, and we don't want to penalize users that use modern OS with default configuration. Those who want to target older OS versions, can specify that versions explicitly. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@240688 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--CMakeLists.txt12
1 files changed, 7 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4a5f25775..edad9f922 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -297,17 +297,19 @@ if(APPLE)
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()
+ elseif(CMAKE_OSX_DEPLOYMENT_TARGET)
+ set(SANITIZER_MIN_OSX_VERSION ${CMAKE_OSX_DEPLOYMENT_TARGET})
else()
- set(SANITIZER_MIN_OSX_VERSION 10.7)
+ set(SANITIZER_MIN_OSX_VERSION 10.9)
if(IOSSIM_SDK_DIR)
list(APPEND SANITIZER_COMMON_SUPPORTED_OS iossim)
endif()
endif()
+ if(SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.7")
+ message(FATAL_ERROR "Too old OS X version: ${SANITIZER_MIN_OSX_VERSION}")
+ endif()
- set(CMAKE_OSX_DEPLOYMENT_TARGET "") # We're setting the flag manually below.
+ set(CMAKE_OSX_DEPLOYMENT_TARGET "") # We evaluate target OS X version above.
set(DARWIN_osx_CFLAGS -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}
-stdlib=libc++)
set(DARWIN_iossim_CFLAGS