From da3a297ecc9186540d2de5d7dafbe8e97b2ef09c Mon Sep 17 00:00:00 2001
From: Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
Date: Tue, 17 Oct 2023 10:37:10 +0200
Subject: [PATCH] Make sure that externally provided CXX flags are not
 discarded.

Mostly the ones coming from the CXXFLAGS environment variable,
defined in special builds of the project.
---
 cmake/configure_cpp_options.cmake | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/cmake/configure_cpp_options.cmake b/cmake/configure_cpp_options.cmake
index 4b7db9d28..73f8202a7 100644
--- a/cmake/configure_cpp_options.cmake
+++ b/cmake/configure_cpp_options.cmake
@@ -21,12 +21,12 @@ set( CMAKE_CXX_EXTENSIONS FALSE CACHE BOOL "(Dis)allow using GNU extensions" )
 set( CMAKE_CXX_STANDARD_REQUIRED TRUE CACHE BOOL "Require the specified C++ standard for the build" )
 
 # Setting CMAKE_CXX_FLAGS to avoid "deprecated" warnings
-set(CMAKE_CXX_FLAGS "-Wno-deprecated-declarations" ) # very basic
-#set(CMAKE_CXX_FLAGS "-Wall -Werror -pedantic-errors -Wno-deprecated-declarations" ) # good enough for a quick, better check
-#set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -pedantic-errors -Wno-deprecated-declarations" ) # better for a thorough check
-#set(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -pedantic-errors" ) # better for an even more severe check
-#set(CMAKE_CXX_FLAGS "-Weverything -Werror -pedantic-errors" ) # not recommended, it warns for really EVERYTHING!
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations" ) # very basic
+#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -pedantic-errors -Wno-deprecated-declarations" ) # good enough for a quick, better check
+#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -pedantic-errors -Wno-deprecated-declarations" ) # better for a thorough check
+#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -pedantic-errors" ) # better for an even more severe check
+#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything -Werror -pedantic-errors" ) # not recommended, it warns for really EVERYTHING!
 
 # TODO: for Debug and with GCC, do we want to set the flags below by default?
 # set( CMAKE_BUILD_TYPE DEBUG )
-# set(CMAKE_CXX_FLAGS "-fPIC -O0 -g -gdwarf-2" )
+# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -O0 -g -gdwarf-2" )
-- 
GitLab