Skip to content

Commit

Permalink
C++ flags: Add them in a failsafe manner
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed Mar 3, 2024
1 parent 278ee34 commit 71cabbf
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,11 @@ endif()
###############################################################################
# some variables/options of this project

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")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16)
ecbuild_add_cxx_flags("-Wno-write-strings")
ecbuild_add_cxx_flags("-Wno-deprecated")
else()
ecbuild_add_cxx_flags("-Wno-writable-strings")
endif()
elseif( CMAKE_CXX_COMPILER_ID STREQUAL "Cray" )
ecbuild_add_cxx_flags("-Wno-write-strings" NO_FAIL)
ecbuild_add_cxx_flags("-Wno-writable-strings" NO_FAIL)
ecbuild_add_cxx_flags("-Wno-deprecated" NO_FAIL)

if( CMAKE_CXX_COMPILER_ID STREQUAL "Cray" )
set(CMAKE_CXX_FLAGS "-hstd=c++11 ${CMAKE_CXX_FLAGS}")
endif()

Expand Down

0 comments on commit 71cabbf

Please sign in to comment.