Ignore Wdangling-reference warnings on GCC 13

This commit is contained in:
Bartek Kryza
2023-10-25 13:23:54 +02:00
parent 79801b2936
commit 7cf61a98aa
2 changed files with 11 additions and 3 deletions

View File

@@ -136,14 +136,21 @@ endif()
# Setup custom compile options depending on various compiler
# and environment quirks
#
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "13.0")
# Workaround over Wdangling-reference false positives in libfmt
set(CUSTOM_COMPILE_OPTIONS ${CUSTOM_COMPILE_OPTIONS} -Wno-dangling-reference)
endif()
endif()
if(LLVM_VERSION_MAJOR GREATER_EQUAL 17)
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CUSTOM_COMPILE_OPTIONS "-Wno-class-memaccess")
set(CUSTOM_COMPILE_OPTIONS ${CUSTOM_COMPILE_OPTIONS} -Wno-class-memaccess)
endif()
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CUSTOM_COMPILE_OPTIONS
"${CUSTOM_COMPILE_OPTIONS} -Wno-unused-private-field")
${CUSTOM_COMPILE_OPTIONS} -Wno-unused-private-field)
endif()
#
@@ -219,4 +226,4 @@ option(BUILD_TESTS "" ON)
if(BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif(BUILD_TESTS)
endif(BUILD_TESTS)