diff options
author | robot-ya-builder <robot-ya-builder@yandex-team.com> | 2023-04-05 17:38:35 +0300 |
---|---|---|
committer | robot-ya-builder <robot-ya-builder@yandex-team.com> | 2023-04-05 17:38:35 +0300 |
commit | 7456291b9b9c90d528322880dd744bfc3c94e046 (patch) | |
tree | d6d4b60c9804071017b8be0830003af40b263618 | |
parent | 54ad0af8cfe99687f95779e2d97d3e6ad6b350d4 (diff) | |
download | ydb-7456291b9b9c90d528322880dd744bfc3c94e046.tar.gz |
External build system generator release 25
Update tools: yexport
-rw-r--r-- | cmake/llvm-tools.cmake | 23 | ||||
-rw-r--r-- | cmake/protobuf.cmake | 46 |
2 files changed, 66 insertions, 3 deletions
diff --git a/cmake/llvm-tools.cmake b/cmake/llvm-tools.cmake index b1cd8beeb4..717a023608 100644 --- a/cmake/llvm-tools.cmake +++ b/cmake/llvm-tools.cmake @@ -38,11 +38,22 @@ endif() function(llvm_compile_cxx Tgt Inpt Out Tool UseC) list(APPEND TARGET_INCLUDES "-I$<JOIN:$<TARGET_PROPERTY:${Tgt},INCLUDE_DIRECTORIES>,$<SEMICOLON>-I>") list(APPEND TARGET_COMPILE_OPTIONS "$<JOIN:$<TARGET_PROPERTY:${Tgt},COMPILE_OPTIONS>,$<SEMICOLON>>") + list(APPEND TARGET_COMPILE_DEFINITIONS "-D$<JOIN:$<TARGET_PROPERTY:${Tgt},COMPILE_DEFINITIONS>,$<SEMICOLON>-D>") if (${UseC}) - set(STD_FLAG "") + set(STD_FLAG "") + separate_arguments(LANG_FLAGS NATIVE_COMMAND ${CMAKE_C_FLAGS}) + separate_arguments(FLAGSLIST_DEBUG NATIVE_COMMAND ${CMAKE_C_FLAGS_DEBUG}) + separate_arguments(FLAGSLIST_RELEASE NATIVE_COMMAND ${CMAKE_C_FLAGS_RELEASE}) + separate_arguments(FLAGSLIST_MINSIZEREL NATIVE_COMMAND ${CMAKE_C_FLAGS_MINSIZEREL}) + separate_arguments(FLAGSLIST_RELWITHDEBINFO NATIVE_COMMAND ${CMAKE_C_FLAGS_RELWITHDEBINFO}) else() - get_target_property(TARGET_STANDARD ${Tgt} CXX_STANDARD) - set(STD_FLAG "-std=c++${TARGET_STANDARD}") + get_target_property(TARGET_STANDARD ${Tgt} CXX_STANDARD) + set(STD_FLAG "-std=c++${TARGET_STANDARD}") + separate_arguments(LANG_FLAGS NATIVE_COMMAND ${CMAKE_CXX_FLAGS}) + separate_arguments(FLAGSLIST_DEBUG NATIVE_COMMAND ${CMAKE_CXX_FLAGS_DEBUG}) + separate_arguments(FLAGSLIST_RELEASE NATIVE_COMMAND ${CMAKE_CXX_FLAGS_RELEASE}) + separate_arguments(FLAGSLIST_MINSIZEREL NATIVE_COMMAND ${CMAKE_CXX_FLAGS_MINSIZEREL}) + separate_arguments(FLAGSLIST_RELWITHDEBINFO NATIVE_COMMAND ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) endif() add_custom_command( @@ -51,6 +62,12 @@ function(llvm_compile_cxx Tgt Inpt Out Tool UseC) ${Tool} ${TARGET_INCLUDES} ${TARGET_COMPILE_OPTIONS} + ${LANG_FLAGS} + "$<$<CONFIG:DEBUG>:${FLAGSLIST_DEBUG}>" + "$<$<CONFIG:RELEASE>:${FLAGSLIST_RELEASE}>" + "$<$<CONFIG:MINSIZEREL>:${FLAGSLIST_MINSIZEREL}>" + "$<$<CONFIG:RELWITHDEBINFO>:${FLAGSLIST_RELWITHDEBINFO}>" + ${TARGET_COMPILE_DEFINITIONS} ${STD_FLAG} -Wno-unknown-warning-option -fno-lto diff --git a/cmake/protobuf.cmake b/cmake/protobuf.cmake index 880ac6cd8b..774f0c7a3e 100644 --- a/cmake/protobuf.cmake +++ b/cmake/protobuf.cmake @@ -63,3 +63,49 @@ function(target_proto_messages Tgt Scope) ) endforeach() endfunction() + +function(target_ev_messages Tgt Scope) + get_built_tool_path(protoc_bin protoc_dependency contrib/tools/protoc/bin protoc) + get_built_tool_path(cpp_styleguide_bin cpp_styleguide_dependency contrib/tools/protoc/plugins/cpp_styleguide cpp_styleguide) + get_built_tool_path(event2cpp_bin event2cpp_dependency tools/event2cpp/bin event2cpp) + + get_property(ProtocExtraOutsSuf TARGET ${Tgt} PROPERTY PROTOC_EXTRA_OUTS) + foreach(proto ${ARGN}) + if(proto MATCHES ${CMAKE_BINARY_DIR}) + file(RELATIVE_PATH protoRel ${CMAKE_BINARY_DIR} ${proto}) + elseif (proto MATCHES ${CMAKE_SOURCE_DIR}) + file(RELATIVE_PATH protoRel ${CMAKE_SOURCE_DIR} ${proto}) + else() + set(protoRel ${proto}) + endif() + get_filename_component(OutputBase ${protoRel} NAME_WLE) + get_filename_component(OutputDir ${CMAKE_BINARY_DIR}/${protoRel} DIRECTORY) + list(TRANSFORM ProtocExtraOutsSuf PREPEND ${OutputDir}/${OutputBase} OUTPUT_VARIABLE ProtocExtraOuts) + add_custom_command( + OUTPUT + ${OutputDir}/${OutputBase}.ev.pb.cc + ${OutputDir}/${OutputBase}.ev.pb.h + ${ProtocExtraOuts} + COMMAND ${protoc_bin} + ${COMMON_PROTOC_FLAGS} + "-I$<JOIN:$<TARGET_GENEX_EVAL:${Tgt},$<TARGET_PROPERTY:${Tgt},PROTO_ADDINCL>>,;-I>" + "$<JOIN:$<TARGET_GENEX_EVAL:${Tgt},$<TARGET_PROPERTY:${Tgt},PROTO_OUTS>>,;>" + --plugin=protoc-gen-cpp_styleguide=${cpp_styleguide_bin} + --plugin=protoc-gen-event2cpp=${event2cpp_bin} + "$<JOIN:$<TARGET_GENEX_EVAL:${Tgt},$<TARGET_PROPERTY:${Tgt},PROTOC_OPTS>>,;>" + ${protoRel} + DEPENDS + ${proto} + $<TARGET_PROPERTY:${Tgt},PROTOC_DEPS> + ${protoc_dependency} + ${cpp_styleguide_dependency} + ${event2cpp_dependency} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + COMMAND_EXPAND_LISTS + ) + target_sources(${Tgt} ${Scope} + ${OutputDir}/${OutputBase}.ev.pb.cc ${OutputDir}/${OutputBase}.ev.pb.h + ${ProtocExtraOuts} + ) + endforeach() +endfunction() |