Skip to content

Commit a89c512

Browse files
committed
improved options
1 parent 86e76d4 commit a89c512

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

cmake/compilers.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ endblock()
140140
if(CMAKE_C_COMPILER_ID MATCHES "Clang|GNU|^Intel")
141141
add_compile_options(
142142
"$<$<AND:$<COMPILE_LANGUAGE:C,CXX>,$<CONFIG:Debug>>:-Wextra>"
143-
"$<$<COMPILE_LANGUAGE:C,CXX>:-Wall;-Werror=array-bounds>"
143+
"$<$<AND:$<COMPILE_LANGUAGE:C,CXX>,$<CONFIG:Debug,RelWithDebInfo>>:-Wall;-Werror=array-bounds>"
144144
"$<$<COMPILE_LANGUAGE:C>:-Werror=implicit-function-declaration>"
145145
)
146146
elseif(CMAKE_C_COMPILER_ID MATCHES "MSVC")
@@ -154,7 +154,7 @@ add_compile_options("$<$<COMPILE_LANGUAGE:Fortran>:-eI>")
154154
elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
155155

156156
add_compile_options(
157-
"$<$<COMPILE_LANGUAGE:Fortran>:-Wall>"
157+
"$<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<CONFIG:Debug,RelWithDebInfo>>:-Wall>"
158158
"$<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<CONFIG:Debug>>:-Wextra>"
159159
"$<$<COMPILE_LANGUAGE:Fortran>:-fimplicit-none>"
160160
"$<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<CONFIG:Release>>:-fno-backtrace>"
@@ -169,7 +169,7 @@ add_compile_options(
169169
)
170170

171171
# -fpscomp logicals is required for C_BOOL
172-
add_compile_options("$<$<COMPILE_LANGUAGE:Fortran>:-fpscomp;logicals>")
172+
add_compile_options("$<$<COMPILE_LANGUAGE:Fortran>:-fpscomp:logicals>")
173173

174174
# -stand f18 is just for warnings, it doesn't change compiler behavior
175175

0 commit comments

Comments
 (0)