Skip to content

Commit cee233d

Browse files
committed
compiler debug options
1 parent 1320927 commit cee233d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

cmake/compilers.cmake

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1-
if(NOT MSVC)
1+
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang|Intel")
22
add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wall>)
33
endif()
44

5+
if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
6+
add_compile_options(
7+
"$<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:Debug,RelWithDebInfo>>:-Wextra>"
8+
)
9+
endif()
10+
511
if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
612
add_compile_options($<$<COMPILE_LANGUAGE:Fortran>:-Wall>)
13+
add_compile_options(
14+
"$<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<CONFIG:Debug,RelWithDebInfo>>:-Wextra;-fcheck=all;-Werror=array-bounds>"
15+
)
16+
717
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^Intel")
818
add_compile_options(
919
"$<$<COMPILE_LANGUAGE:Fortran>:-warn>"

0 commit comments

Comments
 (0)