summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2022-01-03 01:38:52 +0100
committerSlávek Banko <slavek.banko@axis.cz>2022-01-03 01:40:46 +0100
commit499759760390de286418deaea9303739533ec6c8 (patch)
treef16134650de02172ee18d7779af631334e50c28e
parente42c55b006f868f16bd3bc2b9fef8eb116404ca6 (diff)
downloadtde-cmake-499759760390de286418deaea9303739533ec6c8.tar.gz
tde-cmake-499759760390de286418deaea9303739533ec6c8.zip
Add the ability to specify the necessary CXX features in tde_add_check_executable.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz> (cherry picked from commit 538040ff2d48561f9503f1ef2e6c0f6018461ecc)
-rw-r--r--modules/TDEMacros.cmake13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/TDEMacros.cmake b/modules/TDEMacros.cmake
index d19fc59..f2e754e 100644
--- a/modules/TDEMacros.cmake
+++ b/modules/TDEMacros.cmake
@@ -1300,6 +1300,7 @@ macro( tde_add_check_executable _arg_target )
unset( _test_args )
unset( _meta_includes )
unset( _sources )
+ unset( _cxx_features )
unset( _destination )
unset( _link )
unset( _dependencies )
@@ -1336,6 +1337,12 @@ macro( tde_add_check_executable _arg_target )
set( _storage "_sources" )
endif( "+${_arg}" STREQUAL "+SOURCES" )
+ # found directive "CXX_FEATURES"
+ if( "+${_arg}" STREQUAL "+CXX_FEATURES" )
+ set( _skip_store 1 )
+ set( _storage "_cxx_features" )
+ endif( "+${_arg}" STREQUAL "+CXX_FEATURES" )
+
# found directive "LINK"
if( "+${_arg}" STREQUAL "+LINK" )
set( _skip_store 1 )
@@ -1377,6 +1384,12 @@ macro( tde_add_check_executable _arg_target )
# add target
add_executable( ${_target} EXCLUDE_FROM_ALL ${_sources} )
+ # set cxx features
+ if( TDE_CXX_FEATURES OR PROJECT_CXX_FEATURES OR _cxx_features )
+ target_compile_features( ${_target} PRIVATE
+ ${TDE_CXX_FEATURES} ${PROJECT_CXX_FEATURES} ${_cxx_features} )
+ endif( )
+
# set link libraries
if( _link )
target_link_libraries( ${_target} ${_link} )