From 8e29e3d79de2f6823685259257c3f61e431b702f Mon Sep 17 00:00:00 2001 From: Thomas Madlener Date: Wed, 2 Oct 2024 15:36:56 +0200 Subject: [PATCH] Disable dangling-reference warning (#116) * Disable dangling-reference warning Too many false positives * Use CXX specifc flags --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bde7c15..8f77318d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,10 @@ if(NOT CMAKE_CXX_STANDARD MATCHES "17|20") message(FATAL_ERROR "Unsupported C++ standard: ${CMAKE_CXX_STANDARD}") endif() +if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always -Wno-dangling-reference") +endif() + set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})