build: target_compile_features now uses CMAKE_CXX_STANDARD
This commit is contained in:
1 parent
e9284652ab
commit
64056ee321
1 file changed
+7
-1
@@ -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})
|
||||
|
||||
|
||||
Reference in new issue
Block a user