summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorKuba Brecka <kuba.brecka@gmail.com>2016-10-08 09:01:27 +0000
committerKuba Brecka <kuba.brecka@gmail.com>2016-10-08 09:01:27 +0000
commit2232cef62de7658bc0356ea1de79c2fe3226ad82 (patch)
treeb2c2bab770d6ca5034698dc4aa92ed877c07c34f /CMakeLists.txt
parent9b149609c0dc08dc75537c44d43038c0e34b1321 (diff)
[compiler-rt] Exclude compiler-rt from using -fmodules when LLVM_ENABLE_MODULES=On
Sanitizers are intentionally not including system headers and often declare slightly different function prototypes, which is incompatible with -fmodules and -fcxx-modules. Let’s simply exclude compiler-rt from using -fmodules. Differential Revision: https://reviews.llvm.org/D25230 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@283658 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 256d74c4e..5b1591e8a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -205,6 +205,12 @@ elseif(MSVC)
llvm_replace_compiler_option(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Z[i7I]" "/Z7")
endif()
+if(LLVM_ENABLE_MODULES)
+ # Sanitizers cannot be built with -fmodules. The interceptors intentionally
+ # don't include system headers, which is incompatible with modules.
+ list(APPEND SANITIZER_COMMON_CFLAGS -fno-modules)
+endif()
+
# Turn off several warnings.
append_list_if(COMPILER_RT_HAS_WGNU_FLAG -Wno-gnu SANITIZER_COMMON_CFLAGS)
append_list_if(COMPILER_RT_HAS_WVARIADIC_MACROS_FLAG -Wno-variadic-macros SANITIZER_COMMON_CFLAGS)