From af85d45d87a38dcadecc1bcc5ed6d4a380044609 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Mon, 9 Sep 2024 21:57:06 +0200 Subject: [PATCH] Update Key4hepConfig.cmake with fixes from https://github.com/key4hep/key4hep-dev-utils/pull/7 --- cmake/Key4hepConfig.cmake | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cmake/Key4hepConfig.cmake b/cmake/Key4hepConfig.cmake index 1309ed9f8..6dd524abe 100644 --- a/cmake/Key4hepConfig.cmake +++ b/cmake/Key4hepConfig.cmake @@ -1,7 +1,8 @@ +# Do not edit this file, it will be overwritten! +# The template file can be found in +# https://github.com/key4hep/key4hep-dev-utils/blob/main/defaults/cmake/Key4hepConfig.cmake + macro(key4hep_set_compiler_flags) - if (DEFINED KEY4HEP_SET_COMPILER_FLAGS AND NOT KEY4HEP_SET_COMPILER_FLAGS) - return() - endif() set(COMPILER_FLAGS "-fPIC -Wall -Wextra -Wpedantic -Wshadow -Wdeprecated") @@ -11,7 +12,10 @@ macro(key4hep_set_compiler_flags) set(COMPILER_FLAGS "${COMPILER_FLAGS} -fdiagnostics-color=always") endif() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMPILER_FLAGS}") + if (DEFINED KEY4HEP_SET_COMPILER_FLAGS AND NOT KEY4HEP_SET_COMPILER_FLAGS) + else() + set(CMAKE_CXX_FLAGS "${COMPILER_FLAGS} ${CMAKE_CXX_FLAGS}") + endif() endmacro()