Skip to content

Commit

Permalink
build: target_compile_features now uses CMAKE_CXX_STANDARD
Browse files Browse the repository at this point in the history
  • Loading branch information
mpusz committed Sep 19, 2024
1 parent e928465 commit 64056ee
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/cmake/AddMPUnitsModule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,13 @@ function(add_mp_units_module name target_name)

# define the target for a module
add_library(${target_name} ${SCOPE})
target_compile_features(${target_name} ${${projectPrefix}TARGET_SCOPE} cxx_std_20)

if(DEFINED CMAKE_CXX_STANDARD AND CMAKE_CXX_STANDARD GREATER 20)
# TODO revise when a fixed version of CMake is released
target_compile_features(${target_name} ${${projectPrefix}TARGET_SCOPE} cxx_std_${CMAKE_CXX_STANDARD})
else()
target_compile_features(${target_name} ${${projectPrefix}TARGET_SCOPE} cxx_std_20)
endif()
target_link_libraries(${target_name} ${${projectPrefix}TARGET_SCOPE} ${ARG_DEPENDENCIES})
set_target_properties(${target_name} PROPERTIES EXPORT_NAME ${name})

Expand Down

0 comments on commit 64056ee

Please sign in to comment.