diff --git a/CMakeLists.txt b/CMakeLists.txt index f0b0f2aec2..f24206ba95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -241,6 +241,14 @@ endif () set (CMAKE_Fortran_FLAGS_RELEASE "${GEOS_Fortran_FLAGS_VECT}") +# This 'resets' the Intel DEBUG flags for FMS. The stock debug flags use +# 'all,noarg_temp_created' which seem to be too aggressive for FMS/MOM6. This +# moves them back to the 'bounds,uninit' GEOS used to build with. +if (CMAKE_Fortran_COMPILER_ID MATCHES "Intel" AND CMAKE_BUILD_TYPE MATCHES Debug) + string(REPLACE "all,noarg_temp_created" "bounds,uninit" _tmp "${GEOS_Fortran_FLAGS_DEBUG}") + set (CMAKE_Fortran_FLAGS_DEBUG "${_tmp}") +endif () + if (CMAKE_Fortran_COMPILER_ID MATCHES "NAG") target_compile_options (${lib} PRIVATE $<$:-kind=byte>) endif ()