summaryrefslogtreecommitdiff
path: root/cmake/Modules/CompilerRTCompile.cmake
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-12-30 11:52:19 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-12-30 11:52:19 +0000
commit5c909fa013fc285f010a95e8d387e0ef3412da9c (patch)
tree1059d068ad281f4776ff44cd414574f99a460023 /cmake/Modules/CompilerRTCompile.cmake
parentf31bcc68c72371a2bf63aead9f3373a1ff2053b6 (diff)
Notes
Diffstat (limited to 'cmake/Modules/CompilerRTCompile.cmake')
-rw-r--r--cmake/Modules/CompilerRTCompile.cmake6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmake/Modules/CompilerRTCompile.cmake b/cmake/Modules/CompilerRTCompile.cmake
index b2e62dd0bac64..48f40bf4f7530 100644
--- a/cmake/Modules/CompilerRTCompile.cmake
+++ b/cmake/Modules/CompilerRTCompile.cmake
@@ -49,6 +49,10 @@ macro(clang_compile object_file source)
translate_msvc_cflags(global_flags "${global_flags}")
endif()
+ if (APPLE)
+ set(global_flags ${OSX_SYSROOT_FLAG} ${global_flags})
+ endif()
+
# Ignore unknown warnings. CMAKE_CXX_FLAGS may contain GCC-specific options
# which are not supported by Clang.
list(APPEND global_flags -Wno-unknown-warning-option)
@@ -72,7 +76,7 @@ endmacro()
macro(clang_compiler_add_cxx_check)
if (APPLE)
set(CMD
- "echo '#include <iostream>' | ${COMPILER_RT_TEST_COMPILER} -E -x c++ - > /dev/null"
+ "echo '#include <iostream>' | ${COMPILER_RT_TEST_COMPILER} ${OSX_SYSROOT_FLAG} -E -x c++ - > /dev/null"
"if [ $? != 0 ] "
" then echo"
" echo 'Your just-built clang cannot find C++ headers, which are needed to build and run compiler-rt tests.'"