Skip to content

Commit

Permalink
Add back ROOT C++17 compilation check as it must match to BDM C++17 f…
Browse files Browse the repository at this point in the history
…lag.
  • Loading branch information
FonsRademakers committed Feb 2, 2024
1 parent 869a9ed commit 600cdb1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ endfunction()
# will be downloaded. If the found cached ROOT is not the right
# version (SHA256 check with builtin expected SHA256) then
# a new version will be downloaded.
# If a user installed ROOT is found we will check it is at least v6.22.xx.
# If a user installed ROOT is found we will check if ROOT
# was compiled using c++17.
function(verify_ROOT)
if(ROOT_FOUND AND CMAKE_THIRD_PARTY_DIR)
# check if found ROOT is BDM installed (matchres > -1)
Expand Down Expand Up @@ -103,6 +104,14 @@ function(verify_ROOT)
SET(ROOTCLING_EXECUTABLE ${ROOTCLING_EXECUTABLE} PARENT_SCOPE)
SET(GENREFLEX_EXECUTABLE ${GENREFLEX_EXECUTABLE} PARENT_SCOPE)
else()
# When ROOT is found, but it's not C++17 compliant, we exit the installation, because ROOT needs
# to be properly sourced prior to invoking CMake (CMake cannot do this for us, because it requires
# reverting the previous find_package() call, which is not possible.)
if(NOT ROOT_cxx17_FOUND)
message(FATAL_ERROR "The ROOT installation found in ${ROOTSYS} is not C++17 compliant. "
"Please unset ROOTSYS and re-run cmake so that a compatible version of ROOT will be downloaded.")
endif()

if (NOT DEFINED ROOTSYS OR NOT DEFINED ${ROOTSYS})
# Set ROOTSYS variable
string(REGEX REPLACE "/include$" "" TMP_ROOT_PATH ${ROOT_INCLUDE_DIRS})
Expand Down

0 comments on commit 600cdb1

Please sign in to comment.