diff --git a/cmake/compilers.cmake b/cmake/compilers.cmake index 15ef6ab..259b0f7 100644 --- a/cmake/compilers.cmake +++ b/cmake/compilers.cmake @@ -1,9 +1,19 @@ -if(NOT MSVC) +if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang|Intel") add_compile_options($<$:-Wall>) endif() +if(CMAKE_C_COMPILER_ID STREQUAL "GNU") + add_compile_options( + "$<$,$>:-Wextra>" + ) +endif() + if(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") add_compile_options($<$:-Wall>) + add_compile_options( + "$<$,$>:-Wextra;-fcheck=all;-Werror=array-bounds>" + ) + elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^Intel") add_compile_options( "$<$:-warn>"