From be27e477fa6ab9446f182fd911d82f76f6ba19ed Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Tue, 31 May 2022 13:55:56 +0200 Subject: Turn off gcc 12 compiler warning about lack of support for instrumenting std::atomic_thread_fence with thread sanitizer --- build_settings.cmake | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'build_settings.cmake') 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 -- cgit v1.2.3