Browse Source

Add semantic and protoc_extra_outs for deps.pb.h

Add semantic for deps.pb.h
commit_hash:fb9944288736e5ca8162baf88ca903bd896de7b0
dimdim11 5 months ago
parent
commit
f16f882b5f

+ 5 - 1
build/conf/proto.conf

@@ -45,6 +45,8 @@ CPP_PROTO_SUFFIXES=.pb.h .pb.cc
 CPP_PROTO_PLUGINS=
 CPP_PROTO_NO_DBGINFO=no
 
+PROTOC_EXTRA_OUTS_SEM=
+
 # tag:proto tag:cpp-specific
 CPP_EV_OPTS=--plugin=protoc-gen-event2cpp=${tool:"tools/event2cpp"} --event2cpp_out=$ARCADIA_BUILD_ROOT -I=$ARCADIA_ROOT/library/cpp/eventlog
 CPP_EV_OUTS=
@@ -208,8 +210,9 @@ macro WITH_KOTLIN_GRPC() {
 
 # tag:proto tag:cpp-specific
 macro _ADD_CPP_PROTO_OUT(Suf) {
-    .SEM=append_target_property PROTOC_EXTRA_OUTS $Suf && protoc_extra_outs $Suf ${output;hide;suf=.o:Suf} $_ADD_SEM_PROP_IF_NON_EMPTY(PROTO_NAMESPACE $PROTO_NAMESPACE)
+    .SEM=append_target_property PROTOC_EXTRA_OUTS $Suf ${output;hide;suf=.o:Suf} $_ADD_SEM_PROP_IF_NON_EMPTY(PROTO_NAMESPACE $PROTO_NAMESPACE)
     SET_APPEND(CPP_PROTO_OUTS \${output;norel;nopath;noext;suf=$Suf:File})
+    SET_APPEND(PROTOC_EXTRA_OUTS_SEM && protoc_extra_outs $Suf)
 
     # XXX fix variable expansion in plugins
     SET(CPP_PROTO_SUFFIXES $CPP_PROTO_SUFFIXES $Suf)
@@ -387,6 +390,7 @@ macro YT_ORM_PROTO_YSON(OUT_OPTS[], Files...) {
 _SEM_CPP_PROTO_CMD=target_proto_messages PRIVATE ${input:File} \
                    && target_options-privates-ITEM && target_options-privates-option target_proto_messages && target_options-privates-args ${input:File} \
                    $CPP_PROTO_OUTS_SEM ${output;hide;suf=${OBJ_SUF}.pb.o:File} $DEFAULT_PROTOC_TOOLS \
+                   $PROTOC_EXTRA_OUTS_SEM \
                    && set_global_flags COMMON_PROTOC_FLAGS \
                    && platform_vars-COMMON_PROTOC_FLAGS "" \
                    && target_proto_outs --cpp_out=$ARCADIA_BUILD_ROOT/$PROTO_NAMESPACE $PROTOC_STYLEGUIDE_OUT \

+ 1 - 1
build/export_generators/cmake/target_properties.jinja

@@ -15,7 +15,7 @@ set_property(TARGET {{ name }} PROPERTY {{ property.name }}
 
 {%- if (current_target.protoc_extra_outs is defined) and (current_target.protoc_extra_outs|length) %}
 set_property(TARGET {{ name }} PROPERTY PROTOC_EXTRA_OUTS
-{%-     for protoc_extra_out in current_target.protoc_extra_outs %}
+{%-     for protoc_extra_out in current_target.protoc_extra_outs|unique %}
   {{ protoc_extra_out }}
 {%-     endfor %}
 )

+ 2 - 0
build/ymake.core.conf

@@ -631,6 +631,8 @@ module _BASE_UNIT: _BARE_UNIT {
         when ($PROTOC_TRANSITIVE_HEADERS == "no") {
             CPP_PROTO_PLUGINS=proto_h=true:${CPP_PROTO_PLUGINS}
             CPP_PROTO_OUTS+=${output;main;norel;nopath;noext:File.deps.pb.h}
+            CPP_PROTO_OUTS_SEM+=${output;main;hide;norel;nopath;noext:File.deps.pb.h}
+            PROTOC_EXTRA_OUTS_SEM=&& protoc_extra_outs .deps.pb.h
         }
     }