Use C++ standard from target in CMake macro

This commit is contained in:
Martchus 2018-07-27 17:40:06 +02:00
parent 7fcbead8e3
commit 29cd810507
1 changed files with 2 additions and 0 deletions

View File

@ -113,6 +113,8 @@ function(add_reflection_generator_invocation)
# add options to be passed to clang from the specified targets
if(ARGS_CLANG_OPTIONS_FROM_TARGETS)
foreach(TARGET_NAME ${ARGS_CLANG_OPTIONS_FROM_TARGETS})
# set c++ standard
list(APPEND CLANG_TIDY_CXX_FLAGS "-std=c++$<TARGET_PROPERTY:${TARGET_NAME},CXX_STANDARD>")
# add compile flags
set(PROP "$<TARGET_PROPERTY:${TARGET_NAME},COMPILE_FLAGS>")
list(APPEND ARGS_CLANG_OPTIONS "$<$<BOOL:${PROP}>:$<JOIN:${PROP},$<SEMICOLON>>>")