diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index d5813706832d..971637859889 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -16,6 +16,8 @@ function(add_fmt_executable name) # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95353 if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0) + target_compile_options(${name} PRIVATE -Wno-stringop-overflow) + # The linker flag is needed for LTO. target_link_libraries(${name} -Wno-stringop-overflow) endif () endfunction()