Skip to content

Commit

Permalink
[cmake] Add back cxx_std_ compile feature
Browse files Browse the repository at this point in the history
Partially revert commit d487a42 ("[cmake] Set CMAKE_CXX_STANDARD
explicitly in RootUseFile.cmake") because this is required to propagate
the C++ standard via CMake library targets, as advertised on the
website.

Fixes #15253
  • Loading branch information
hahnjo committed Apr 17, 2024
1 parent 002d793 commit 80cdfa2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmake/modules/RootMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,10 @@ function(ROOT_LINKER_LIBRARY library)
target_link_libraries(${library} PUBLIC ${ARG_LIBRARIES} ${ARG_DEPENDENCIES})
endif()

if(DEFINED CMAKE_CXX_STANDARD)
target_compile_features(${library} INTERFACE cxx_std_${CMAKE_CXX_STANDARD})
endif()

if(PROJECT_NAME STREQUAL "ROOT")
if(NOT TARGET ROOT::${library})
add_library(ROOT::${library} ALIAS ${library})
Expand Down

0 comments on commit 80cdfa2

Please # to comment.