Skip to content

Commit

Permalink
compiler debug options
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Feb 8, 2024
1 parent 1320927 commit cee233d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cmake/compilers.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
if(NOT MSVC)
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang|Intel")
add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wall>)
endif()

if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
add_compile_options(
"$<$<AND:$<COMPILE_LANGUAGE:C>,$<CONFIG:Debug,RelWithDebInfo>>:-Wextra>"
)
endif()

if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
add_compile_options($<$<COMPILE_LANGUAGE:Fortran>:-Wall>)
add_compile_options(
"$<$<AND:$<COMPILE_LANGUAGE:Fortran>,$<CONFIG:Debug,RelWithDebInfo>>:-Wextra;-fcheck=all;-Werror=array-bounds>"
)

elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^Intel")
add_compile_options(
"$<$<COMPILE_LANGUAGE:Fortran>:-warn>"
Expand Down

0 comments on commit cee233d

Please sign in to comment.