diff options
author | Tor Egge <Tor.Egge@online.no> | 2022-05-31 13:55:56 +0200 |
---|---|---|
committer | Tor Egge <Tor.Egge@online.no> | 2022-05-31 13:55:56 +0200 |
commit | be27e477fa6ab9446f182fd911d82f76f6ba19ed (patch) | |
tree | 345c6ab9b4bde0a3828b996fef440e021df7c3db /build_settings.cmake | |
parent | da8c0d839fb45fddd4b59efa5a469d0b7e948d3f (diff) |
Turn off gcc 12 compiler warning about lack of support for instrumenting
std::atomic_thread_fence with thread sanitizer
Diffstat (limited to 'build_settings.cmake')
-rw-r--r-- | build_settings.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/build_settings.cmake b/build_settings.cmake index d0cf6f38326..e36c56eb9e6 100644 --- a/build_settings.cmake +++ b/build_settings.cmake @@ -32,6 +32,13 @@ if (VESPA_USE_SANITIZER) else() set(C_WARN_OPTS "-Winline ${C_WARN_OPTS}") endif() +if (VESPA_USE_SANITIZER) + if (VESPA_USE_SANITIZER STREQUAL "thread" AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 12.0) + # Turn off warning about std::atomic_thread_fence not being supported by + # address sanitizer. + set(C_WARN_OPTS "${C_WARN_OPTS} -Wno-tsan") + endif() +endif() # Warnings that are specific to C++ compilation # Note: this is not a union of C_WARN_OPTS, since CMAKE_CXX_FLAGS already includes CMAKE_C_FLAGS, which in turn includes C_WARN_OPTS transitively |