Skip to content

Commit 370520a

Browse files
committed
Enable the new command engine in semantics, batch #1
commit_hash:5b246144e81555f1bc12b2c8ca111e351dcd5ed7
1 parent f268e1f commit 370520a

File tree

3 files changed

+54
-24
lines changed

3 files changed

+54
-24
lines changed

build/conf/bison_lex.conf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,17 @@ macro _SRC("y", SRC, SRCFLAGS...) {
139139
.PEERDIR=build/induced/by_bison
140140
.CMD=${tool:"contrib/tools/bison"} $BISON_FLAGS ${env:_SRC_y_env} $_BISON_HEADER ${hide:_BISON_GEN_EXT} -o ${output;suf=$_BISON_GEN_EXT;nopath:SRC} ${input:SRC} ${SRCFLAGS} ${hide;kv:"p YC"} ${hide;kv:"pc light-green"} && $_BISON_PP
141141
.STRUCT_CMD=yes
142-
.SEM=target_macroses-ITEM && target_macroses-macro target_bison_parser && target_macroses-args PRIVATE ${input:SRC} ${hide;output;suf=${OBJ_SUF}.o;nopath;noext:SRC} ${hide;nopath;noext;output;suf=.h:SRC} ${hide;nopath;noext;addincl;output;suf=.h:SRC} && platform_vars-BISON_FLAGS ${quo:BISON_FLAGS} && conan-tool_requires m4/1.4.19 && conan-imports 'bin, m4* -> ./bin/m4/bin' && conan-tool_requires bison/3.8.2 && conan-imports 'bin, bison* -> ./bin/bison/bin' && conan-imports 'res, * -> ./bin/bison/res'
142+
.SEM=target_macroses-ITEM && target_macroses-macro target_bison_parser && target_macroses-args PRIVATE ${input:SRC} ${hide;output;suf=${OBJ_SUF}.o;nopath;noext:SRC} ${hide;output;suf=.h;nopath;noext:SRC} ${hide;addincl;output;suf=.h;nopath;noext:SRC} && platform_vars-BISON_FLAGS ${join= :BISON_FLAGS} && conan-tool_requires m4/1.4.19 && conan-imports 'bin, m4* -> ./bin/m4/bin' && conan-tool_requires bison/3.8.2 && conan-imports 'bin, bison* -> ./bin/bison/bin' && conan-imports 'res, * -> ./bin/bison/res'
143+
.STRUCT_SEM=yes
143144
}
144145

145146
macro _SRC("ypp", SRC, SRCFLAGS...) {
146147
.PEERDIR=build/induced/by_bison
147148
# TODO overloading support and redirection to `$_SRC(y $SRC $SRCFLAGS)`
148149
.CMD=${tool:"contrib/tools/bison"} $BISON_FLAGS ${env:_SRC_y_env} $_BISON_HEADER ${hide:_BISON_GEN_EXT} -o ${output;suf=$_BISON_GEN_EXT;nopath:SRC} ${input:SRC} ${SRCFLAGS} ${hide;kv:"p YC"} ${hide;kv:"pc light-green"} && $_BISON_PP
149150
.STRUCT_CMD=yes
150-
.SEM=$_SRC(y $SRC $SRCFLAGS)
151+
.SEM=target_macroses-ITEM && target_macroses-macro target_bison_parser && target_macroses-args PRIVATE ${input:SRC} ${hide;output;suf=${OBJ_SUF}.o;nopath;noext:SRC} ${hide;output;suf=.h;nopath;noext:SRC} ${hide;addincl;output;suf=.h;nopath;noext:SRC} && platform_vars-BISON_FLAGS ${join= :BISON_FLAGS} && conan-tool_requires m4/1.4.19 && conan-imports 'bin, m4* -> ./bin/m4/bin' && conan-tool_requires bison/3.8.2 && conan-imports 'bin, bison* -> ./bin/bison/bin' && conan-imports 'res, * -> ./bin/bison/res'
152+
.STRUCT_SEM=yes
151153
}
152154

153155
macro _SRC("l", SRC, SRCFLAGS...) {

build/conf/proto.conf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,9 @@ macro JAVA_PROTO_PLUGIN(NAME, TOOL, DEPS[]) {
197197
SET(JAVA_PROTOBUF_PEERS $JAVA_PROTOBUF_PEERS $DEPS)
198198
}
199199

200+
_ADD_SEM_PROP_IF_NON_EMPTY__CMDS=target_properties-ITEM && target_properties-name $Prop && target_properties-value $Args
200201
macro _ADD_SEM_PROP_IF_NON_EMPTY(Prop, Args...) {
201-
.SEM=${pre=&& target_properties-ITEM && target_properties-name $Prop && target_properties-value :Args}
202+
.SEM=$IF(${not;empty:Args} THEN $_ADD_SEM_PROP_IF_NON_EMPTY__CMDS)
202203
}
203204

204205
# tag:proto tag:java-specific
@@ -216,7 +217,7 @@ macro WITH_KOTLIN_GRPC() {
216217
# tag:proto tag:cpp-specific
217218
macro _ADD_CPP_PROTO_OUT(Suf) {
218219
SET_APPEND(CPP_PROTO_OUTS \${norel;output;suf=$Suf;nopath;noext:File})
219-
SET_APPEND(PROTOC_EXTRA_OUTS_SEM && protoc_extra_outs $Suf \${hide;output;suf=.o:Suf} \$_ADD_SEM_PROP_IF_NON_EMPTY(PROTO_NAMESPACE $PROTO_NAMESPACE))
220+
SET_APPEND(PROTOC_EXTRA_OUTS_SEM && protoc_extra_outs $Suf && \$_ADD_SEM_PROP_IF_NON_EMPTY(PROTO_NAMESPACE $PROTO_NAMESPACE))
220221

221222
# XXX fix variable expansion in plugins
222223
SET(CPP_PROTO_SUFFIXES $CPP_PROTO_SUFFIXES $Suf)
@@ -232,7 +233,8 @@ CPP_PROTOBUF_PEERS=
232233
### Define protoc plugin for C++ with given Name that emits code into regular outputs
233234
### using Tool. Extra dependencies are passed via DEPS.
234235
macro CPP_PROTO_PLUGIN0(NAME, TOOL, DEPS[], EXTRA_OUT_FLAG="") {
235-
.SEM=target_macroses-ITEM && target_macroses-macro target_proto_plugin && target_macroses-args $NAME ${tool;rootrel:TOOL} ${hide;output;suf=.fake.o:NAME}
236+
.SEM=target_macroses-ITEM && target_macroses-macro target_proto_plugin && target_macroses-args $NAME ${tool:TOOL} ${hide;output;suf=.fake.o:NAME}
237+
.STRUCT_SEM=yes
236238
SET_APPEND(CPP_PROTO_OPTS $_PROTO_PLUGIN_ARGS_BASE($NAME $TOOL $EXTRA_OUT_FLAG))
237239

238240
# XXX fix variable expansion in plugins
@@ -419,7 +421,7 @@ macro YT_ORM_PROTO_YSON(OUT_OPTS[], Files...) {
419421

420422
_SEM_CPP_PROTO_CMD=target_options-privates-ITEM && target_options-privates-option target_proto_messages && target_options-privates-args ${input:File} \
421423
$CPP_PROTO_OUTS_SEM ${hide;output;suf=${OBJ_SUF}.pb.o:File} $DEFAULT_PROTOC_TOOLS \
422-
$PROTOC_EXTRA_OUTS_SEM \
424+
&& $PROTOC_EXTRA_OUTS_SEM \
423425
&& platform_vars-COMMON_PROTOC_FLAGS "" \
424426
&& target_macroses-ITEM && target_macroses-macro target_proto_outs && target_macroses-args --cpp_out=$ARCADIA_BUILD_ROOT/$PROTO_NAMESPACE $PROTOC_STYLEGUIDE_OUT \
425427
&& target_macroses-ITEM && target_macroses-macro target_proto_addincls && target_macroses-args ./$PROTO_NAMESPACE $ARCADIA_ROOT/$PROTO_NAMESPACE ${_PROTO__INCLUDE} $ARCADIA_BUILD_ROOT $PROTOBUF_INCLUDE_PATH

0 commit comments

Comments
 (0)