Skip to content
Snippets Groups Projects
Commit 07da1cef authored by Marco Clemencic's avatar Marco Clemencic
Browse files

Use C++20 when building with gcc>=13 or clang>=16

parent b10c7474
No related branches found
No related tags found
1 merge request!114Use C++20 when building with gcc>=13 or clang>=16
###############################################################################
# (c) Copyright 2021 CERN for the benefit of the LHCb Collaboration #
# (c) Copyright 2021-2024 CERN for the benefit of the LHCb Collaboration #
# #
# This software is distributed under the terms of the GNU General Public #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". #
......@@ -19,7 +19,13 @@ find_data_package(Geant4Files ${Geant4_VERSION_MAJOR}${Geant4_VERSION_MINOR}.0)
# FIXME: this should match the version used by ROOT (LCG version + compiler version)
set(GEANT4_BUILD_CXXSTD 17 CACHE STRING "C++ Standard")
if( (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "13.0")
OR (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "16.0") )
set(LHCB_DEFAULT_CXXSTD 17)
else()
set(LHCB_DEFAULT_CXXSTD 20)
endif()
set(GEANT4_BUILD_CXXSTD ${LHCB_DEFAULT_CXXSTD} CACHE STRING "C++ Standard")
set(OpenGL_GL_PREFERENCE "GLVND" CACHE STRING
"Preferred GL library to use (see https://cmake.org/cmake/help/v3.12/policy/CMP0072.html)")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment