summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorKuba Brecka <kuba.brecka@gmail.com>2015-11-11 14:53:57 +0000
committerKuba Brecka <kuba.brecka@gmail.com>2015-11-11 14:53:57 +0000
commit2ab569e9198fba1a55bd0b7d084a7567352a05a5 (patch)
tree9768ea34cb2e1fea464cf9574d5e7eae5b2052ed /cmake
parenta95fccfa2f802d78e4449a082b9c5d03d7988176 (diff)
[tsan] Add TSan unit test support for OS X
This patch enables building and running TSan unit tests on OS X. Differential Revision: http://reviews.llvm.org/D14546 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@252731 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/CompilerRTCompile.cmake13
-rw-r--r--cmake/config-ix.cmake11
2 files changed, 11 insertions, 13 deletions
diff --git a/cmake/Modules/CompilerRTCompile.cmake b/cmake/Modules/CompilerRTCompile.cmake
index 850d109c2..48f40bf4f 100644
--- a/cmake/Modules/CompilerRTCompile.cmake
+++ b/cmake/Modules/CompilerRTCompile.cmake
@@ -24,19 +24,6 @@ function(translate_msvc_cflags out_flags msvc_flags)
set(${out_flags} "${clang_flags}" PARENT_SCOPE)
endfunction()
-if (APPLE)
- # On Darwin if /usr/include doesn't exist, the user probably has Xcode but not
- # the command line tools. If this is the case, we need to find the OS X
- # sysroot to pass to clang.
- if(NOT EXISTS /usr/include)
- execute_process(COMMAND xcodebuild -version -sdk macosx Path
- OUTPUT_VARIABLE OSX_SYSROOT
- ERROR_QUIET
- OUTPUT_STRIP_TRAILING_WHITESPACE)
- set(OSX_SYSROOT_FLAG "-isysroot${OSX_SYSROOT}")
- endif()
-endif()
-
# Compile a source into an object file with COMPILER_RT_TEST_COMPILER using
# a provided compile flags and dependenices.
# clang_compile(<object> <source>
diff --git a/cmake/config-ix.cmake b/cmake/config-ix.cmake
index f137d51c7..60ea3d91b 100644
--- a/cmake/config-ix.cmake
+++ b/cmake/config-ix.cmake
@@ -279,6 +279,17 @@ set(ALL_SAFESTACK_SUPPORTED_ARCH ${X86} ${X86_64})
if(APPLE)
include(CompilerRTDarwinUtils)
+ # On Darwin if /usr/include doesn't exist, the user probably has Xcode but not
+ # the command line tools. If this is the case, we need to find the OS X
+ # sysroot to pass to clang.
+ if(NOT EXISTS /usr/include)
+ execute_process(COMMAND xcodebuild -version -sdk macosx Path
+ OUTPUT_VARIABLE OSX_SYSROOT
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ set(OSX_SYSROOT_FLAG "-isysroot${OSX_SYSROOT}")
+ endif()
+
option(COMPILER_RT_ENABLE_IOS "Enable building for iOS - Experimental" Off)
find_darwin_sdk_dir(DARWIN_osx_SYSROOT macosx)