diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e9a7966..566b38f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -10,19 +10,24 @@ endif() if(CMAKE_C_COMPILER_ID MATCHES "^(Intel)$") set(CMAKE_C_FLAGS "-g ${CMAKE_C_FLAGS}") set(CMAKE_C_FLAGS_RELEASE "-O3") +elseif(CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$") + set(CMAKE_C_FLAGS "-ggdb ${CMAKE_C_FLAGS}") + set(CMAKE_C_FLAGS_RELEASE "-O3") +endif() + +if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$") set(CMAKE_Fortran_FLAGS "-g ${CMAKE_Fortran_FLAGS}") set(CMAKE_Fortran_FLAGS_RELEASE "-O3") set(fortran_d_flags "-r8") set(fortran_8_flags "-i8 -r8") -elseif(CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$") - set(CMAKE_C_FLAGS "-ggdb ${CMAKE_C_FLAGS}") - set(CMAKE_C_FLAGS_RELEASE "-O3") +elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$") set(CMAKE_Fortran_FLAGS "-ggdb -fno-range-check -fbacktrace -funroll-loops ${CMAKE_Fortran_FLAGS}") set(CMAKE_Fortran_FLAGS_RELEASE "-O3") set(fortran_d_flags "-fdefault-real-8") set(fortran_8_flags "-fdefault-integer-8 -fdefault-real-8") endif() + if(${CMAKE_Fortran_COMPILER_ID} MATCHES "^(GNU)$" AND ${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL 10) set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -w -fallow-argument-mismatch -fallow-invalid-boz") endif()