Skip to content

Commit

Permalink
Add a check for the standard that Geant4 was compiled with
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcarcell committed Nov 20, 2023
1 parent b6659fa commit 91808aa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ if(DD4HEP_USE_GEANT4)
IF(NOT Geant4_builtin_clhep_FOUND)
SET(DD4HEP_USE_CLHEP TRUE)
ENDIF()
if(Geant4_CXX_STANDARD MATCHES "[0-9]+" AND Geant4_CXX_STANDARD LESS ${CMAKE_CXX_STANDARD})
message(FATAL_ERROR "Geant4 was compiled with C++${Geant4_CXX_STANDARD}, but DD4hep requires C++${CMAKE_CXX_STANDARD}")
endif()

DD4HEP_SETUP_GEANT4_TARGETS()
# Geant4 sets the CLHEP include directory to include_directories, we undo this here
# we don't do this inside DD4hep_SETUP_GEANT4_TARGETS, because that is also used in
Expand Down

0 comments on commit 91808aa

Please sign in to comment.