Skip to content

Commit

Permalink
GCC 10 flags, compiler check, and settable flags
Browse files Browse the repository at this point in the history
  • Loading branch information
kgerheiser authored Aug 27, 2020
1 parent d96d250 commit 4e2555b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,25 @@ elseif(UNIX)
endif()

if(CMAKE_C_COMPILER_ID MATCHES "^(Intel)$")
set(CMAKE_C_FLAGS "-g")
set(CMAKE_C_FLAGS "-g ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "-O3")
set(CMAKE_Fortran_FLAGS "-g")
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")
set(CMAKE_C_FLAGS "-ggdb ${CMAKE_C_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "-O3")
set(CMAKE_Fortran_FLAGS "-ggdb -fno-range-check -fbacktrace -funroll-loops")
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()

set_source_files_properties(${c_src} PROPERTIES COMPILE_OPTIONS "${c_flags}")

# One target for real32 and one target for real64
Expand Down

0 comments on commit 4e2555b

Please sign in to comment.