build: target_compile_features now uses CMAKE_CXX_STANDARD

This commit is contained in:
Mateusz Pusz
2024-09-19 14:50:32 -06:00
parent e9284652ab
commit 64056ee321

View File

@@ -64,7 +64,13 @@ function(add_mp_units_module name target_name)
# define the target for a module # define the target for a module
add_library(${target_name} ${SCOPE}) add_library(${target_name} ${SCOPE})
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) target_compile_features(${target_name} ${${projectPrefix}TARGET_SCOPE} cxx_std_20)
endif()
target_link_libraries(${target_name} ${${projectPrefix}TARGET_SCOPE} ${ARG_DEPENDENCIES}) target_link_libraries(${target_name} ${${projectPrefix}TARGET_SCOPE} ${ARG_DEPENDENCIES})
set_target_properties(${target_name} PROPERTIES EXPORT_NAME ${name}) set_target_properties(${target_name} PROPERTIES EXPORT_NAME ${name})