forked from mpusz/mp-units
build: target_compile_features
now uses CMAKE_CXX_STANDARD
This commit is contained in:
@@ -64,7 +64,13 @@ function(add_mp_units_module name target_name)
|
||||
|
||||
# define the target for a module
|
||||
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)
|
||||
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