From 5c909fa013fc285f010a95e8d387e0ef3412da9c Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Wed, 30 Dec 2015 11:52:19 +0000 Subject: Vendor import of compiler-rt trunk r256633: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256633 --- cmake/Modules/CompilerRTCompile.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'cmake/Modules/CompilerRTCompile.cmake') 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 ' | ${COMPILER_RT_TEST_COMPILER} -E -x c++ - > /dev/null" + "echo '#include ' | ${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.'" -- cgit v1.2.3