From 82f6d8e47c5618e5de786543b98a4363cacccd10 Mon Sep 17 00:00:00 2001 From: Michael Hirsch Date: Sun, 21 Nov 2021 14:11:52 -0500 Subject: [PATCH] simplify compile option syntax --- cmake/compilers.cmake | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) 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()