fixed: quote in case of no existing flags

this can happen for fortran flags as opm is not
using fortran itself (but it's potentially enabled
by BLAS)
This commit is contained in:
Arne Morten Kvarving 2023-03-15 10:26:40 +01:00
parent b30fe5fc4a
commit d0b6546a38

View File

@ -67,9 +67,9 @@ if (CXX_COMPAT_GCC)
if(WITH_NDEBUG)
foreach(type ${_prof_RELEASE})
string(TOUPPER ${type} type)
string(REPLACE -UNDEBUG "" CMAKE_CXX_FLAGS_${type} ${CMAKE_CXX_FLAGS_${type}})
string(REPLACE -UNDEBUG "" CMAKE_C_FLAGS_${type} ${CMAKE_C_FLAGS_${type}})
string(REPLACE -UNDEBUG "" CMAKE_Fortran_FLAGS_${type} ${CMAKE_Fortran_FLAGS_${type}})
string(REPLACE -UNDEBUG "" CMAKE_CXX_FLAGS_${type} "${CMAKE_CXX_FLAGS_${type}}")
string(REPLACE -UNDEBUG "" CMAKE_C_FLAGS_${type} "${CMAKE_C_FLAGS_${type}}")
string(REPLACE -UNDEBUG "" CMAKE_Fortran_FLAGS_${type} "${CMAKE_Fortran_FLAGS_${type}}")
endforeach()
else()
add_options (ALL_LANGUAGES "${_prof_RELEASE}" -UNDEBUG)