File tree Expand file tree Collapse file tree 3 files changed +14
-30
lines changed Expand file tree Collapse file tree 3 files changed +14
-30
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,8 @@ macro(add_compiler_rt_darwin_dynamic_runtime name os)
113
113
LIBRARY DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} )
114
114
endmacro ()
115
115
116
+ set (COMPILER_RT_TEST_CFLAGS )
117
+
116
118
# Unittests support.
117
119
set (COMPILER_RT_GTEST_PATH ${LLVM_MAIN_SRC_DIR} /utils/unittest/googletest )
118
120
set (COMPILER_RT_GTEST_SOURCE ${COMPILER_RT_GTEST_PATH} /src/gtest-all.cc )
@@ -124,8 +126,18 @@ set(COMPILER_RT_GTEST_CFLAGS
124
126
)
125
127
126
128
if (MSVC )
129
+ # clang doesn't support exceptions on Windows yet.
130
+ list (APPEND COMPILER_RT_TEST_CFLAGS
131
+ -D_HAS_EXCEPTIONS=0 )
132
+
133
+ # We should teach clang to understand "#pragma intrinsic", see PR19898.
134
+ list (APPEND COMPILER_RT_TEST_CFLAGS -Wno-undefined-inline )
135
+
127
136
# Clang doesn't support SEH on Windows yet.
128
137
list (APPEND COMPILER_RT_GTEST_CFLAGS -DGTEST_HAS_SEH=0 )
138
+
139
+ # gtest use a lot of stuff marked as deprecated on Windows.
140
+ list (APPEND COMPILER_RT_GTEST_CFLAGS -Wno-deprecated-declarations )
129
141
endif ()
130
142
131
143
# Link objects into a single executable with COMPILER_RT_TEST_COMPILER,
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ set(ASAN_UNITTEST_HEADERS
21
21
asan_test_utils.h )
22
22
23
23
set (ASAN_UNITTEST_COMMON_CFLAGS
24
+ ${COMPILER_RT_TEST_CFLAGS}
24
25
${COMPILER_RT_GTEST_CFLAGS}
25
26
-I${COMPILER_RT_SOURCE_DIR}/include
26
27
-I${COMPILER_RT_SOURCE_DIR}/lib
@@ -39,21 +40,6 @@ else()
39
40
list (APPEND ASAN_UNITTEST_COMMON_CFLAGS -g )
40
41
endif ()
41
42
42
- if (MSVC )
43
- # MSVC system headers and gtest use a lot of deprecated stuff.
44
- list (APPEND ASAN_UNITTEST_COMMON_CFLAGS
45
- -Wno-deprecated-declarations )
46
-
47
- # clang doesn't support exceptions on Windows yet.
48
- list (APPEND ASAN_UNITTEST_COMMON_CFLAGS
49
- -D_HAS_EXCEPTIONS=0 )
50
-
51
- # We should teach clang to understand more pragmas.
52
- list (APPEND ASAN_UNITTEST_COMMON_CFLAGS
53
- -Wno-unknown-pragmas
54
- -Wno-undefined-inline )
55
- endif ()
56
-
57
43
# Use -D instead of definitions to please custom compile command.
58
44
list (APPEND ASAN_UNITTEST_COMMON_CFLAGS
59
45
-DASAN_HAS_BLACKLIST=1
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ foreach(header ${SANITIZER_HEADERS})
34
34
endforeach ()
35
35
36
36
set (SANITIZER_TEST_CFLAGS_COMMON
37
+ ${COMPILER_RT_TEST_CFLAGS}
37
38
${COMPILER_RT_GTEST_CFLAGS}
38
39
-I${COMPILER_RT_SOURCE_DIR}/include
39
40
-I${COMPILER_RT_SOURCE_DIR}/lib
@@ -50,21 +51,6 @@ else()
50
51
list (APPEND ASAN_UNITTEST_COMMON_CFLAGS -g )
51
52
endif ()
52
53
53
- if (MSVC )
54
- # MSVC system headers and gtest use a lot of deprecated stuff.
55
- list (APPEND SANITIZER_TEST_CFLAGS_COMMON
56
- -Wno-deprecated-declarations )
57
-
58
- # clang doesn't support exceptions on Windows yet.
59
- list (APPEND SANITIZER_TEST_CFLAGS_COMMON
60
- -D_HAS_EXCEPTIONS=0 )
61
-
62
- # We should teach clang to understand more pragmas.
63
- list (APPEND SANITIZER_TEST_CFLAGS_COMMON
64
- -Wno-unknown-pragmas
65
- -Wno-undefined-inline )
66
- endif ()
67
-
68
54
if (NOT MSVC )
69
55
list (APPEND SANITIZER_TEST_LINK_FLAGS_COMMON --driver-mode=g++ )
70
56
endif ()
You can’t perform that action at this time.
0 commit comments