Skip to content

Commit

Permalink
add -std=legacy to gfortran flags for version 8
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadAlTurany committed Nov 7, 2018
1 parent 010d6f7 commit 9b706bc
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions cmake/Geant3BuildLibrary.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ cmake_minimum_required(VERSION 2.6.4 FATAL_ERROR)
#-- ROOT (required) ------------------------------------------------------------
if(NOT ROOT_FOUND)
find_package(ROOT REQUIRED)
endif(NOT ROOT_FOUND)
endif(NOT ROOT_FOUND)
include_directories(${ROOT_INCLUDE_DIRS})

#-------------------------------------------------------------------------------
Expand All @@ -25,7 +25,7 @@ include_directories(${ROOT_INCLUDE_DIRS})
include_directories(
${PROJECT_SOURCE_DIR}
${PROJECT_SOURCE_DIR}/minicern
${PROJECT_SOURCE_DIR}/TGeant3
${PROJECT_SOURCE_DIR}/TGeant3
${CMAKE_CURRENT_BINARY_DIR})

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -58,7 +58,7 @@ set(directories
# Fortran sources
set(fortran_sources gcinit.F)
foreach(_directory ${directories})
file(GLOB add_f_sources
file(GLOB add_f_sources
${PROJECT_SOURCE_DIR}/${_directory}/*.F)
list(APPEND fortran_sources ${add_f_sources})
endforeach()
Expand All @@ -69,25 +69,25 @@ list(REMOVE_ITEM fortran_sources ${PROJECT_SOURCE_DIR}/gtrak/grndm.F)
list(REMOVE_ITEM fortran_sources ${PROJECT_SOURCE_DIR}/gtrak/grndmq.F)
list(REMOVE_ITEM fortran_sources ${PROJECT_SOURCE_DIR}/erdecks/eustep.F)
#message(STATUS "fortran_sources ${fortran_sources}")

# C sources
set(c_sources)
foreach(_directory ${directories})
file(GLOB add_c_sources
file(GLOB add_c_sources
${PROJECT_SOURCE_DIR}/${_directory}/*.c)
list(APPEND c_sources ${add_c_sources})
endforeach()
list(APPEND c_sources ${PROJECT_SOURCE_DIR}/minicern/lnxgs/ishftr.c)
# Linux specific, the file is kept on macosx, macosx64)
list(REMOVE_ITEM c_sources ${PROJECT_SOURCE_DIR}/minicern/lnblnk.c)
#message(STATUS "c_sources ${c_sources}")

# C++ sources
file(GLOB cxx_sources
file(GLOB cxx_sources
${PROJECT_SOURCE_DIR}/comad/gcadd.cxx
${PROJECT_SOURCE_DIR}/TGeant3/*.cxx)
#message(STATUS "cxx_sources ${cxx_sources}")

#-------------------------------------------------------------------------------
# Locate headers for this project
#
Expand All @@ -105,6 +105,13 @@ set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -finit-local-zero -fno-strict-ov
# -DCERNLIB_DECS (alphagcc, alphacxx6)
# -DCERNLIB_SUN (solarisCC5)
# -DCERNLIB_HPUX (hpuxacc)

if (${CMAKE_Fortran_COMPILER} MATCHES gfortran+)
if (${CMAKE_Fortran_COMPILER_VERSION} VERSION_GREATER_EQUAL "8")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -std=legacy")
endif()
endif()

if (CMAKE_SIZEOF_VOID_P EQUAL 8)
add_definitions(-DCERNLIB_LXIA64)
else()
Expand Down

0 comments on commit 9b706bc

Please sign in to comment.