From 98e8126ae94bdbeb2457fca2e3dec2c02203aefb Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Thu, 1 Feb 2024 12:08:34 +0000 Subject: [PATCH] CMake: Attempt to fix broken CI workflow (clang@rocky-8.6) (part 2) --- CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 94bab62b7..152d8ec1f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,8 +77,10 @@ if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) ecbuild_add_cxx_flags("-Wno-write-strings") ecbuild_add_cxx_flags("-Wno-deprecated") elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") - ecbuild_add_cxx_flags("-Wno-write-strings") - ecbuild_add_cxx_flags("-Wno-deprecated") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16) + ecbuild_add_cxx_flags("-Wno-write-strings") + ecbuild_add_cxx_flags("-Wno-deprecated") + endif() elseif( CMAKE_CXX_COMPILER_ID STREQUAL "Cray" ) set(CMAKE_CXX_FLAGS "-hstd=c++11 ${CMAKE_CXX_FLAGS}") endif() @@ -480,10 +482,10 @@ endif() ############################################################################### # Debugging aid. Print all known CMake variables -# get_cmake_property(_variableNames VARIABLES) -# foreach( _variableName ${_variableNames} ) +#get_cmake_property(_variableNames VARIABLES) +#foreach( _variableName ${_variableNames} ) # ecbuild_info(" ${_variableName}=${${_variableName}}") -# endforeach() +#endforeach() ############################################################################### # finalize