Skip to content

Commit

Permalink
Merge pull request #21 from NOAA-EMC/gcc-10-settable-flags
Browse files Browse the repository at this point in the history
GCC 10, compiler check, and settable flags
  • Loading branch information
aerorahul authored Aug 27, 2020
2 parents c1d79fd + 3a4dd6c commit fa097df
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@ include("list_of_files.cmake")

if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
set(CMAKE_Fortran_FLAGS
"-g -traceback -auto -convert big_endian -assume byterecl -fp-model strict -fpp"
"-g -traceback -auto -convert big_endian -assume byterecl -fp-model strict -fpp ${CMAKE_Fortran_FLAGS}"
)
set(CMAKE_Fortran_FLAGS_RELEASE "-O3")
set(fortran_d_flags "-i4 -r8")
set(fortran_8_flags "-i8 -r8")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$")
set(CMAKE_Fortran_FLAGS "-g -fbacktrace -fconvert=big-endian")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU)$")
set(CMAKE_Fortran_FLAGS "-g -fbacktrace -fconvert=big-endian ${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()

if(APPLE)
add_compile_definitions(APPLE)
elseif(UNIX)
Expand Down

0 comments on commit fa097df

Please sign in to comment.