diff options
-rw-r--r-- | CMakeLists.txt | 6 |
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) |