From 9f54e1f043dc522f14ce53c7356f4de1ae316c63 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 17 Mar 2008 08:55:05 -0400 Subject: [PATCH] ENH: Patch from Maik to add per-configuration default flags to GCC and Intel Fortran compilers on Linux. --- Modules/Platform/Linux-GNU-Fortran.cmake | 15 +++++++++++++++ Modules/Platform/Linux-ifort.cmake | 10 ++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Modules/Platform/Linux-GNU-Fortran.cmake b/Modules/Platform/Linux-GNU-Fortran.cmake index ba13a4381..16d63fc2f 100644 --- a/Modules/Platform/Linux-GNU-Fortran.cmake +++ b/Modules/Platform/Linux-GNU-Fortran.cmake @@ -1 +1,16 @@ SET(CMAKE_Fortran_MODDIR_FLAG -J) +SET (CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-fPIC") # -pic +SET (CMAKE_Fortran_FLAGS_INIT "") +SET (CMAKE_Fortran_FLAGS_DEBUG_INIT "-g") +SET (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os") +SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3") +SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g") + +IF(NOT APPLE) + SET (CMAKE_INCLUDE_SYSTEM_FLAG_Fortran "-isystem ") +ENDIF(NOT APPLE) + +# These will require updates to CMake C++ code to support +# preprocessing rules for Fortran. +#SET (CMAKE_Fortran_CREATE_PREPROCESSED_SOURCE " -E > ") +#SET (CMAKE_Fortran_CREATE_ASSEMBLY_SOURCE " -S -o ") diff --git a/Modules/Platform/Linux-ifort.cmake b/Modules/Platform/Linux-ifort.cmake index dc46dd51c..06de82b24 100644 --- a/Modules/Platform/Linux-ifort.cmake +++ b/Modules/Platform/Linux-ifort.cmake @@ -1,8 +1,14 @@ SET(CMAKE_DL_LIBS "dl") -SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-fPIC") +SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-fPIC") SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-shared") -SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-i_dynamic") +SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-i_dynamic") SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG "-Wl,-rpath,") SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ":") SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-Wl,-soname,") SET(CMAKE_Fortran_MODDIR_FLAG "-module ") + +SET (CMAKE_Fortran_FLAGS_INIT "") +SET (CMAKE_Fortran_FLAGS_DEBUG_INIT "-g") +SET (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os") +SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3") +SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")