summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorTimur Iskhodzhanov <timurrrr@google.com>2014-05-30 12:42:57 +0000
committerTimur Iskhodzhanov <timurrrr@google.com>2014-05-30 12:42:57 +0000
commita73e9db87100939b154c53948d56c3bb9c08a991 (patch)
treef831b879ccb5b569561aa522aa566f1228bf874c /cmake
parent1e47c5c58439fd2fa57b27179af80c1261c90843 (diff)
[Sanitizers Win] Move duplicate Windows-specific compiler flags to a common CMake variable
Reviewed at http://reviews.llvm.org/D3952 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209889 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/AddCompilerRT.cmake12
1 files changed, 12 insertions, 0 deletions
diff --git a/cmake/Modules/AddCompilerRT.cmake b/cmake/Modules/AddCompilerRT.cmake
index 78d2492d1..0f6260ae5 100644
--- a/cmake/Modules/AddCompilerRT.cmake
+++ b/cmake/Modules/AddCompilerRT.cmake
@@ -113,6 +113,8 @@ macro(add_compiler_rt_darwin_dynamic_runtime name os)
LIBRARY DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
endmacro()
+set(COMPILER_RT_TEST_CFLAGS)
+
# Unittests support.
set(COMPILER_RT_GTEST_PATH ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest)
set(COMPILER_RT_GTEST_SOURCE ${COMPILER_RT_GTEST_PATH}/src/gtest-all.cc)
@@ -124,8 +126,18 @@ set(COMPILER_RT_GTEST_CFLAGS
)
if(MSVC)
+ # clang doesn't support exceptions on Windows yet.
+ list(APPEND COMPILER_RT_TEST_CFLAGS
+ -D_HAS_EXCEPTIONS=0)
+
+ # We should teach clang to understand "#pragma intrinsic", see PR19898.
+ list(APPEND COMPILER_RT_TEST_CFLAGS -Wno-undefined-inline)
+
# Clang doesn't support SEH on Windows yet.
list(APPEND COMPILER_RT_GTEST_CFLAGS -DGTEST_HAS_SEH=0)
+
+ # gtest use a lot of stuff marked as deprecated on Windows.
+ list(APPEND COMPILER_RT_GTEST_CFLAGS -Wno-deprecated-declarations)
endif()
# Link objects into a single executable with COMPILER_RT_TEST_COMPILER,