Skip to content

Commit

Permalink
Fix compilation problem and compiler warnings
Browse files Browse the repository at this point in the history
MCStepLogger had compilation issues with conflicting C++ versions
appearing on the command line. This is avoided by a CMakeList simplification.

Also fixing few compilation warnings related to inconsistent virtual + override.
  • Loading branch information
sawenzel committed Jul 1, 2024
1 parent b3db447 commit dc6f458
Show file tree
Hide file tree
Showing 2 changed files with 150 additions and 142 deletions.
30 changes: 19 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,26 @@ find_package(Boost COMPONENTS program_options chrono unit_test_framework REQUIRE
###############################
# Determine CXX STD from ROOT #
###############################
SET(CMAKE_CXX_STANDARD 11)

#
# SW: The following code was there but was
# problematic. In principle, we expect the C++ version
# to be set from the outside via (-DCMAKE_CXX_STANDARD).
# Please send email if this does not work for you.
#

#SET(CMAKE_CXX_STANDARD 11)
# Find ROOT CXX standard
string(FIND ${ROOT_CXX_FLAGS} "-std=" POSITION)
if (${POSITION} GREATER -1)
string(SUBSTRING ${ROOT_CXX_FLAGS} ${POSITION} 11 ROOT_CXX_STD)
if(${ROOT_CXX_STD} STREQUAL "-std=c++1z " OR ${ROOT_CXX_STD} STREQUAL "-std=c++17 ")
SET(CMAKE_CXX_STANDARD 17)
elseif(${ROOT_CXX_STD} STREQUAL "-std=c++1y " OR ${ROOT_CXX_STD} STREQUAL "-std=c++14 ")
SET(CMAKE_CXX_STANDARD 14)
endif()
endif()
message(STATUS "Build with CXX STD ${CMAKE_CXX_STANDARD}")
#string(FIND ${ROOT_CXX_FLAGS} "-std=" POSITION)
#if (${POSITION} GREATER -1)
# string(SUBSTRING ${ROOT_CXX_FLAGS} ${POSITION} 11 ROOT_CXX_STD)
# if(${ROOT_CXX_STD} STREQUAL "-std=c++1z " OR ${ROOT_CXX_STD} STREQUAL "-std=c++17 ")
# SET(CMAKE_CXX_STANDARD 17)
# elseif(${ROOT_CXX_STD} STREQUAL "-std=c++1y " OR ${ROOT_CXX_STD} STREQUAL "-std=c++14 ")
# SET(CMAKE_CXX_STANDARD 14)
# endif()
#endif()
#message(STATUS "Build with CXX STD ${CMAKE_CXX_STANDARD}")

#######################
# Do the installation #
Expand Down
Loading

0 comments on commit dc6f458

Please sign in to comment.