diff --git a/cmake/compilers.cmake b/cmake/compilers.cmake index 2c6a2b6..a6e931c 100644 --- a/cmake/compilers.cmake +++ b/cmake/compilers.cmake @@ -13,12 +13,17 @@ endif() # --- compiler options # we left off "-std=f2018" type flags as they tend to issue false warnings +if(CMAKE_Fortran_COMPILER_ID MATCHES "^Intel") add_compile_options( -$<$:$,/QxHost,-xHost>> -"$<$:-warn;-heap-arrays>" -"$<$,$>:-traceback;-check;-debug>" -"$<$:-mtune=native;-Wall;-fimplicit-none>" -"$<$,$>:-Wextra;-fcheck=all;-Werror=array-bounds>" -"$<$,$>:-fno-backtrace;-Wno-maybe-uninitialized>" -"$<$,$>:-Wno-maybe-uninitialized>" +$,/QxHost,-xHost> +"$<$:-warn;-heap-arrays>" +"$<$,$>:-traceback;-check;-debug>" ) +elseif(CMAKE_Fortran_COMPILER_ID STREQUAL "GNU") +add_compile_options( +"$<$:-mtune=native;-Wall;-fimplicit-none>" +"$<$,$>:-Wextra;-fcheck=all;-Werror=array-bounds>" +"$<$,$>:-fno-backtrace;-Wno-maybe-uninitialized>" +"$<$,$>:-Wno-maybe-uninitialized>" +) +endif()