diff options
author | snermolaev <snermolaev@yandex-team.ru> | 2022-02-10 16:45:53 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:53 +0300 |
commit | 2015790ac9fcc04caab83fccc23ab2460310a797 (patch) | |
tree | e644e9bc3f6f688561a871793b59bf8a637e0f72 /build/ymake.core.conf | |
parent | c768a99151e47c3a4bb7b92c514d256abd301c4d (diff) | |
download | ydb-2015790ac9fcc04caab83fccc23ab2460310a797.tar.gz |
Restoring authorship annotation for <snermolaev@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'build/ymake.core.conf')
-rw-r--r-- | build/ymake.core.conf | 4846 |
1 files changed, 2423 insertions, 2423 deletions
diff --git a/build/ymake.core.conf b/build/ymake.core.conf index 081833998b..2b254dfaa2 100644 --- a/build/ymake.core.conf +++ b/build/ymake.core.conf @@ -15,7 +15,7 @@ ANDROID_FAKEID=8821472 CLANG_TIDY_FAKEID=8625699 CURDIR=. -MODDIR=. +MODDIR=. BINDIR=bin:/ SRCDIR= YMAKE=ymake @@ -44,14 +44,14 @@ when ($OS_WINDOWS != "yes") { USE_GLOBAL_CMD=yes } -YMAKE_RESOURCE_BIN=${YMAKE_RESOURCE_GLOBAL}/ymake -YMAKE_RESOURCE_DIR=build/external_resources/ymake -when ($USE_YMAKE_RESOURCE == "yes") { - PEERDIR+=${YMAKE_RESOURCE_DIR} -} - -__COMMA__=${comma:""} - +YMAKE_RESOURCE_BIN=${YMAKE_RESOURCE_GLOBAL}/ymake +YMAKE_RESOURCE_DIR=build/external_resources/ymake +when ($USE_YMAKE_RESOURCE == "yes") { + PEERDIR+=${YMAKE_RESOURCE_DIR} +} + +__COMMA__=${comma:""} + ARCADIA_TEST_ROOT=../arcadia_tests_data/ DEFAULT_REQUIREMENTS=network:restricted cpu:1 ram:32 CC_REQUIREMENTS=$DEFAULT_REQUIREMENTS @@ -62,31 +62,31 @@ PY_REQUIREMENTS=$DEFAULT_REQUIREMENTS BISON_DATA_DIR=contrib/tools/bison/bison/data CPP_BISON_SKELS=${BISON_DATA_DIR}/glr.cc ${BISON_DATA_DIR}/lalr1.cc ${BISON_DATA_DIR}/yacc.c ${BISON_DATA_DIR}/stack.hh ${BISON_DATA_DIR}/variant.hh ${BISON_DATA_DIR}/c++.m4 ${BISON_DATA_DIR}/c++-skel.m4 -USE_PREBUILT_TOOLS=yes +USE_PREBUILT_TOOLS=yes when ($OPENSOURCE == "yes") { - USE_PREBUILT_TOOLS=no -} - + USE_PREBUILT_TOOLS=no +} + FAIL_PY2=no -_PREBUILT_TOOLS_ROOT=build/prebuilt -_TOOL_PROTOC_GEN_GO=vendor/github.com/golang/protobuf/protoc-gen-go -_TOOL_RESCOMPILER=tools/rescompiler -_TOOL_RESCOMPRESSOR=tools/rescompressor -_TOOL_RORESCOMPILER=tools/rorescompiler - -when ($HOST_ARCH_X86_64 == "yes") { - when ($HOST_OS_DARWIN == "yes" || $HOST_OS_LINUX == "yes" || $HOST_OS_WINDOWS == "yes") { - VALID_HOST_PLATFORM_FOR_COMMON_PREBUILT_TOOLS=yes - - when ($USE_PREBUILT_TOOLS == "yes" && $ARCH_X86_64 == "yes") { - _TOOL_PROTOC_GEN_GO=${_PREBUILT_TOOLS_ROOT}/vendor/github.com/golang/protobuf/protoc-gen-go - } - } -} - -FAIL_MODULE_CMD=$YMAKE_PYTHON ${input:"build/scripts/fail_module_cmd.py"} $TARGET ${kv;hide:"p ER"} ${kv;hide:"pc red"} - +_PREBUILT_TOOLS_ROOT=build/prebuilt +_TOOL_PROTOC_GEN_GO=vendor/github.com/golang/protobuf/protoc-gen-go +_TOOL_RESCOMPILER=tools/rescompiler +_TOOL_RESCOMPRESSOR=tools/rescompressor +_TOOL_RORESCOMPILER=tools/rorescompiler + +when ($HOST_ARCH_X86_64 == "yes") { + when ($HOST_OS_DARWIN == "yes" || $HOST_OS_LINUX == "yes" || $HOST_OS_WINDOWS == "yes") { + VALID_HOST_PLATFORM_FOR_COMMON_PREBUILT_TOOLS=yes + + when ($USE_PREBUILT_TOOLS == "yes" && $ARCH_X86_64 == "yes") { + _TOOL_PROTOC_GEN_GO=${_PREBUILT_TOOLS_ROOT}/vendor/github.com/golang/protobuf/protoc-gen-go + } + } +} + +FAIL_MODULE_CMD=$YMAKE_PYTHON ${input:"build/scripts/fail_module_cmd.py"} $TARGET ${kv;hide:"p ER"} ${kv;hide:"pc red"} + when ($TIDY == "yes") { when ($TIDY_EXPORT_FIXES=="") { TIDY_EXPORT_FIXES="no" @@ -114,28 +114,28 @@ otherwise { when ($CODENAVIGATION && $NOCODENAVIGATION != "yes") { PY_PROGRAM_LINK_EXE=$LINK_EXE ${kv;hide:"pyndex $TARGET"} YNDEXER_ARGS=$YMAKE_PYTHON ${input:"build/scripts/yndexer.py"} $CPPYNDEXER_RESOURCE_GLOBAL/yndexer 1500 $(SOURCE_ROOT) $ARCADIA_BUILD_ROOT ${input:SRC} - YNDEXER_OUTPUT=${output;noauto;suf=${OBJ_CROSS_SUF}.ydx.pb2:SRC} -} -otherwise { + YNDEXER_OUTPUT=${output;noauto;suf=${OBJ_CROSS_SUF}.ydx.pb2:SRC} +} +otherwise { PY_PROGRAM_LINK_EXE=$LINK_EXE - YNDEXER_ARGS= + YNDEXER_ARGS= YNDEXER_OUTPUT= -} +} COVERAGE_FLAGS= -EXTRA_OUTPUT= -when ($CLANG == "yes" || $GCC == "yes") { - when ($BUILD_TYPE == "COVERAGE" || $GCOV_COVERAGE) { - COVERAGE_FLAGS=-fprofile-arcs -ftest-coverage - EXTRA_OUTPUT=${output;noauto;hide;suf=${OBJ_CROSS_SUF}${COMPILE_OUT_SUFFIX}.gcno:SRC} - } -} - -when ($OS_CYGWIN == "yes") { - CFLAGS+=-D_LDBL_EQ_DBL=1 -U__STRICT_ANSI__ - USE_ASMLIB=no - FSTACK= -} +EXTRA_OUTPUT= +when ($CLANG == "yes" || $GCC == "yes") { + when ($BUILD_TYPE == "COVERAGE" || $GCOV_COVERAGE) { + COVERAGE_FLAGS=-fprofile-arcs -ftest-coverage + EXTRA_OUTPUT=${output;noauto;hide;suf=${OBJ_CROSS_SUF}${COMPILE_OUT_SUFFIX}.gcno:SRC} + } +} + +when ($OS_CYGWIN == "yes") { + CFLAGS+=-D_LDBL_EQ_DBL=1 -U__STRICT_ANSI__ + USE_ASMLIB=no + FSTACK= +} CFLAGS+=$COVERAGE_FLAGS LDFLAGS+=$COVERAGE_FLAGS @@ -146,7 +146,7 @@ NO_MAPREDUCE= when ($NO_MAPREDUCE == "yes") { C_DEFINES+=-DNO_MAPREDUCE -} +} when ($OS_ANDROID == "yes") { PIE=yes @@ -168,29 +168,29 @@ when ($MAPSMOBI_BUILD_TARGET == "yes" && $OS_IOS == "yes") { # # USE_STL_SYSTEM=yes is a regular way to select system standard C++ library. # -when ($USE_STL_SYSTEM == "yes") { - USE_INTERNAL_STL=no -} - -when ($USE_INTERNAL_STL == "no") { - USE_STL_SYSTEM=yes -} -otherwise { - USE_INTERNAL_STL=yes +when ($USE_STL_SYSTEM == "yes") { + USE_INTERNAL_STL=no +} + +when ($USE_INTERNAL_STL == "no") { + USE_STL_SYSTEM=yes +} +otherwise { + USE_INTERNAL_STL=yes # TODO: Extract to conf/sysincl.conf - # This trigger doesn't work for module level since SYSINCL is processed at - # configuration stage (This means that NO_RUNTIME() macro called in ya.make - # won't affect SYSINCL and the only way to make this trigger work correctly - # is to define configuration varaible NORUNTIME (-DNORUNTIME) on the command - # line when `ya make ...` is invoked. - when ($NORUNTIME != "yes") { - SYSINCL+=build/sysincl/stl-to-libcxx.yml - when ($MUSL == "yes") { - SYSINCL+=build/sysincl/libc-musl-libcxx.yml - } - } -} - + # This trigger doesn't work for module level since SYSINCL is processed at + # configuration stage (This means that NO_RUNTIME() macro called in ya.make + # won't affect SYSINCL and the only way to make this trigger work correctly + # is to define configuration varaible NORUNTIME (-DNORUNTIME) on the command + # line when `ya make ...` is invoked. + when ($NORUNTIME != "yes") { + SYSINCL+=build/sysincl/stl-to-libcxx.yml + when ($MUSL == "yes") { + SYSINCL+=build/sysincl/libc-musl-libcxx.yml + } + } +} + # tag:linux-specific when ($OS_LINUX && $OS_SDK == "ubuntu-14" && $MUSL != "yes") { USE_UBUNTU_COMPATIBILITY=yes @@ -200,16 +200,16 @@ USE_ARCADIA_PYTHON=yes USE_ARCADIA_LIBM=no USE_EAT_MY_DATA=no -HAVE_MKL= -when ($HAVE_MKL == "") { - when ($OS_LINUX && $ARCH_X86_64 && !$SANITIZER_TYPE) { - HAVE_MKL=yes - } - otherwise { - HAVE_MKL=no - } -} - +HAVE_MKL= +when ($HAVE_MKL == "") { + when ($OS_LINUX && $ARCH_X86_64 && !$SANITIZER_TYPE) { + HAVE_MKL=yes + } + otherwise { + HAVE_MKL=no + } +} + SFDL_TMP_OUT= ${output;tmp:SRC.tmp} # tag:perl-specific @@ -232,46 +232,46 @@ otherwise { # tag:perl-specific PERL_LD_LIBRARY_PATH= PERL_INCLUDE= -USE_PERL_SYSTEM=yes -when ($USE_PERL_SYSTEM == "yes") { - select ($PERL_SDK) { - "ubuntu-12" ? { - PERL_VERSION=5.14 - PERL_ROOT=${SYSTEM_PERL_514_RESOURCE_GLOBAL}/perl${PERL_VERSION} - PERL_LIB_ARCH= - } - "ubuntu-14" ? { - PERL_VERSION=5.18 - PERL_ROOT=${SYSTEM_PERL_518_RESOURCE_GLOBAL}/perl${PERL_VERSION} - PERL_LIB_ARCH= - } - "ubuntu-16" ? { - PERL_VERSION=5.22 - PERL_ROOT=${SYSTEM_PERL_522_RESOURCE_GLOBAL}/perl${PERL_VERSION} - PERL_LIB_ARCH=/x86_64-linux-gnu - } - "ubuntu-18" ? { - PERL_VERSION=5.26 - PERL_ROOT=${SYSTEM_PERL_526_RESOURCE_GLOBAL}/perl${PERL_VERSION} - PERL_LIB_ARCH=/x86_64-linux-gnu - } - "ubuntu-20" ? { - PERL_VERSION=5.30 - PERL_ROOT=${SYSTEM_PERL_530_RESOURCE_GLOBAL}/usr - PERL_LIB_ARCH=/x86_64-linux-gnu - } - } - - PERL=${PERL_ROOT}/bin/perl - PERL_ARCHLIB=${PERL_ROOT}/lib$PERL_LIB_ARCH/perl/${PERL_VERSION} - PERL_PRIVLIB=${PERL_ROOT}/share/perl/${PERL_VERSION} - PERL_LIBS=${PERL_ROOT}/lib${PERL_LIB_ARCH} - PERL_LD_LIBRARY_PATH=${env:"LD_LIBRARY_PATH=${PERL_ROOT}/lib"} - - # Perl searches it's modules in INC@ paths. They can not be sysrooted or disabled (at least I haven't found a way), - # so default Perl module directories should be prepended to perl command lines when using non-local perl. - PERL_INCLUDE=-I${PERL_ARCHLIB} -I${PERL_PRIVLIB} -} +USE_PERL_SYSTEM=yes +when ($USE_PERL_SYSTEM == "yes") { + select ($PERL_SDK) { + "ubuntu-12" ? { + PERL_VERSION=5.14 + PERL_ROOT=${SYSTEM_PERL_514_RESOURCE_GLOBAL}/perl${PERL_VERSION} + PERL_LIB_ARCH= + } + "ubuntu-14" ? { + PERL_VERSION=5.18 + PERL_ROOT=${SYSTEM_PERL_518_RESOURCE_GLOBAL}/perl${PERL_VERSION} + PERL_LIB_ARCH= + } + "ubuntu-16" ? { + PERL_VERSION=5.22 + PERL_ROOT=${SYSTEM_PERL_522_RESOURCE_GLOBAL}/perl${PERL_VERSION} + PERL_LIB_ARCH=/x86_64-linux-gnu + } + "ubuntu-18" ? { + PERL_VERSION=5.26 + PERL_ROOT=${SYSTEM_PERL_526_RESOURCE_GLOBAL}/perl${PERL_VERSION} + PERL_LIB_ARCH=/x86_64-linux-gnu + } + "ubuntu-20" ? { + PERL_VERSION=5.30 + PERL_ROOT=${SYSTEM_PERL_530_RESOURCE_GLOBAL}/usr + PERL_LIB_ARCH=/x86_64-linux-gnu + } + } + + PERL=${PERL_ROOT}/bin/perl + PERL_ARCHLIB=${PERL_ROOT}/lib$PERL_LIB_ARCH/perl/${PERL_VERSION} + PERL_PRIVLIB=${PERL_ROOT}/share/perl/${PERL_VERSION} + PERL_LIBS=${PERL_ROOT}/lib${PERL_LIB_ARCH} + PERL_LD_LIBRARY_PATH=${env:"LD_LIBRARY_PATH=${PERL_ROOT}/lib"} + + # Perl searches it's modules in INC@ paths. They can not be sysrooted or disabled (at least I haven't found a way), + # so default Perl module directories should be prepended to perl command lines when using non-local perl. + PERL_INCLUDE=-I${PERL_ARCHLIB} -I${PERL_PRIVLIB} +} PERL_DEFAULT_PEERDIR=yes # tag:perl-specific @@ -287,9 +287,9 @@ XSUBPPFLAGS= ARCH_TOOL=${tool:"tools/archiver"} # tag:tool-specific tag:proto -PROTOC=${tool:"contrib/tools/protoc"} -PROTOC_STYLEGUIDE_OUT=--cpp_styleguide_out=$ARCADIA_BUILD_ROOT/$PROTO_NAMESPACE -PROTOC_PLUGIN_STYLEGUIDE=--plugin=protoc-gen-cpp_styleguide=${tool:"contrib/tools/protoc/plugins/cpp_styleguide"} +PROTOC=${tool:"contrib/tools/protoc"} +PROTOC_STYLEGUIDE_OUT=--cpp_styleguide_out=$ARCADIA_BUILD_ROOT/$PROTO_NAMESPACE +PROTOC_PLUGIN_STYLEGUIDE=--plugin=protoc-gen-cpp_styleguide=${tool:"contrib/tools/protoc/plugins/cpp_styleguide"} PROTOBUF_PATH=${ARCADIA_ROOT}/contrib/libs/protobuf/src USE_VANILLA_PROTOC=no @@ -311,8 +311,8 @@ ${output_include;hide:"contrib/libs/python/Include/Python.h"} \ ${output_include;hide:"contrib/libs/python/Include/pythread.h"} \ ${output_include;hide:"contrib/libs/python/Include/structmember.h"} \ ${output_include;hide:"contrib/libs/python/Include/traceback.h"} \ -${output_include;hide:"contrib/tools/cython/generated_c_headers.h"} \ -${output_include;hide:"omp.h"} +${output_include;hide:"contrib/tools/cython/generated_c_headers.h"} \ +${output_include;hide:"omp.h"} # tag:cython-specific CYTHON_CPP_OUTPUT_INCLUDES=${output_include;hide:"contrib/tools/cython/generated_cpp_headers.h"} @@ -350,27 +350,27 @@ FATAL_ERROR_MESSAGE= PYTHON_DISTR="default" when ($USE_SYSTEM_PYTHON) { USE_ARCADIA_PYTHON=no - select ($USE_SYSTEM_PYTHON) { - "2.7" ? { + select ($USE_SYSTEM_PYTHON) { + "2.7" ? { _SYSTEM_PYTHON27=yes PY_VERSION=2.7 PY_FRAMEWORK_VERSION=2.7 - } + } "3.4" ? { _SYSTEM_PYTHON34=yes PY_VERSION=3.4m PY_FRAMEWORK_VERSION=3.4 } - "3.5" ? { + "3.5" ? { _SYSTEM_PYTHON35=yes PY_VERSION=3.5m PY_FRAMEWORK_VERSION=3.5 - } - "3.6" ? { + } + "3.6" ? { _SYSTEM_PYTHON36=yes PY_VERSION=3.6m PY_FRAMEWORK_VERSION=3.6 - } + } "3.7" ? { _SYSTEM_PYTHON37=yes PY_VERSION=3.7m @@ -405,21 +405,21 @@ when ($HOST_OS_WINDOWS == "yes") { } # tag:python-specific -when ($USE_ARCADIA_PYTHON == "no") { +when ($USE_ARCADIA_PYTHON == "no") { SYSINCL+=build/sysincl/python.yml -} +} # tag:allocator DEFAULT_ALLOCATOR=LF # tag:allocator -when ($OS_ANDROID == "yes" || $MSVC == "yes") { - DEFAULT_ALLOCATOR=J -} +when ($OS_ANDROID == "yes" || $MSVC == "yes") { + DEFAULT_ALLOCATOR=J +} # tag:allocator -when ($OS_CYGWIN == "yes" || $ARCH_PPC64LE == "yes") { - DEFAULT_ALLOCATOR=SYSTEM +when ($OS_CYGWIN == "yes" || $ARCH_PPC64LE == "yes") { + DEFAULT_ALLOCATOR=SYSTEM } # tag:allocator @@ -428,12 +428,12 @@ when ($OS_DARWIN == "yes") { } # tag:allocator -when ($SANITIZER_TYPE) { - when ($SANITIZER_TYPE != "no") { - DEFAULT_ALLOCATOR=SYSTEM - } -} - +when ($SANITIZER_TYPE) { + when ($SANITIZER_TYPE != "no") { + DEFAULT_ALLOCATOR=SYSTEM + } +} + # tag:internal ### @usage: CHECK_CONFIG_H(<conf_header>) # internal ### @@ -441,11 +441,11 @@ when ($SANITIZER_TYPE) { ### The check is needed to avoid conflicts on certain types and functions available in arcadia. ### ### @see https://a.yandex-team.ru/arc/trunk/arcadia/build/scripts/check_config_h.py for exact details -macro CHECK_CONFIG_H(Conf) { +macro CHECK_CONFIG_H(Conf) { .CMD=$YMAKE_PYTHON ${input:"build/scripts/check_config_h.py"} ${input;rootrel:Conf} ${output;nopath;noext:Conf.config.cpp} ${kv;hide:"p CH"} ${kv;hide:"pc yellow"} - OUTPUT_INCLUDES=$Conf -} - + OUTPUT_INCLUDES=$Conf +} + REQUIRED_TRANSITIVE_PEERS= ### @usage REQUIRES(dirs...) ### @@ -496,7 +496,7 @@ CPP_PROTO_CMDLINE= CPP_PROTO_OPTS= CPP_PROTO_OUTS= CPP_PROTO_SUFFIXES=.pb.h .pb.cc -CPP_PROTO_PLUGINS= +CPP_PROTO_PLUGINS= # 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 @@ -545,29 +545,29 @@ macro RESOURCE(Args...) { } # tag:internal -### @usage: _ORDER_ADDINCL([BUILD ...] [SOURCE ...] Args...) # internal +### @usage: _ORDER_ADDINCL([BUILD ...] [SOURCE ...] Args...) # internal ### -### Order and filter ADDINCLs (Args - is intentionally omitted in ADDINCL macro) -macro _ORDER_ADDINCL(BUILD[], SOURCE[], ARGS...) { - ADDINCL($BUILD $SOURCE) -} - +### Order and filter ADDINCLs (Args - is intentionally omitted in ADDINCL macro) +macro _ORDER_ADDINCL(BUILD[], SOURCE[], ARGS...) { + ADDINCL($BUILD $SOURCE) +} + # tag:proto ### @usage: PROTO_ADDINCL([GLOBAL] [WITH_GEN] Path) -### +### ### This macro introduces proper ADDINCLs for .proto-files found in sources and ### .cpp/.h generated files, supplying them to appropriate commands and allowing ### proper dependency resolution at configure-time. ### ### Note: you normally shouldn't use this macro. ADDINCLs should be sent to user ### from dependency via PROTO_NAMESPACE macro -macro PROTO_ADDINCL(GLOBAL?"GLOBAL":"", Path, WITH_GEN?"BUILD":"") { - _ORDER_ADDINCL($WITH_GEN $GLOBAL FOR proto ${ARCADIA_BUILD_ROOT}/$Path SOURCE $GLOBAL FOR proto ${ARCADIA_ROOT}/$Path) +macro PROTO_ADDINCL(GLOBAL?"GLOBAL":"", Path, WITH_GEN?"BUILD":"") { + _ORDER_ADDINCL($WITH_GEN $GLOBAL FOR proto ${ARCADIA_BUILD_ROOT}/$Path SOURCE $GLOBAL FOR proto ${ARCADIA_ROOT}/$Path) ADDINCL($GLOBAL ${ARCADIA_BUILD_ROOT}/$Path) } # tag:proto -### @usage: PROTO_NAMESPACE([GLOBAL] [WITH_GEN] Namespace) +### @usage: PROTO_NAMESPACE([GLOBAL] [WITH_GEN] Namespace) ### ### Defines protobuf namespace (import/export path prefix) which should be used for imports and ### which defines output path for .proto generation. @@ -576,11 +576,11 @@ macro PROTO_ADDINCL(GLOBAL?"GLOBAL":"", Path, WITH_GEN?"BUILD":"") { ### for both .cpp headers includes and .proto imports. If .proto expected to be used outsed of the ### processing module use GLOBAL to send proper ADDINCLs to all (transitive) users. PEERDIR to ### PROTO_LIBRARY with PROTO_NAMESPACE(GLOBAL ) is enough at user side to correctly use the library. -### If generated .proto files are going to be used for building a module than use of WITH_GEN -### parameter will add appropriate dir from the build root for .proto files search. -macro PROTO_NAMESPACE(GLOBAL?"GLOBAL":"", WITH_GEN?"WITH_GEN":"", Namespace) { +### If generated .proto files are going to be used for building a module than use of WITH_GEN +### parameter will add appropriate dir from the build root for .proto files search. +macro PROTO_NAMESPACE(GLOBAL?"GLOBAL":"", WITH_GEN?"WITH_GEN":"", Namespace) { SET(PROTO_NAMESPACE $Namespace) - PROTO_ADDINCL($GLOBAL $WITH_GEN $Namespace) + PROTO_ADDINCL($GLOBAL $WITH_GEN $Namespace) } # tag:proto tag:internal tag:python-specific @@ -713,60 +713,60 @@ macro USE_SKIFF() { } # tag:go-specific -_GO_COMMON_GOOGLE_APIS = \ -vendor/google.golang.org/genproto/googleapis/api/annotations \ -vendor/google.golang.org/genproto/googleapis/api/configchange \ -vendor/google.golang.org/genproto/googleapis/api/distribution \ -vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1 \ -vendor/google.golang.org/genproto/googleapis/api/expr/v1beta1 \ -vendor/google.golang.org/genproto/googleapis/api/httpbody \ -vendor/google.golang.org/genproto/googleapis/api/label \ -vendor/google.golang.org/genproto/googleapis/api/metric \ -vendor/google.golang.org/genproto/googleapis/api/monitoredres \ -vendor/google.golang.org/genproto/googleapis/api/serviceconfig \ -vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1 \ -vendor/google.golang.org/genproto/googleapis/api/servicemanagement/v1 \ -vendor/google.golang.org/genproto/googleapis/iam/admin/v1 \ -vendor/google.golang.org/genproto/googleapis/iam/credentials/v1 \ -vendor/google.golang.org/genproto/googleapis/iam/v1 \ -vendor/google.golang.org/genproto/googleapis/iam/v1/logging \ -vendor/google.golang.org/genproto/googleapis/logging/type \ -vendor/google.golang.org/genproto/googleapis/logging/v2 \ -vendor/google.golang.org/genproto/googleapis/rpc/code \ -vendor/google.golang.org/genproto/googleapis/rpc/errdetails \ -vendor/google.golang.org/genproto/googleapis/rpc/status \ -vendor/google.golang.org/genproto/googleapis/type/calendarperiod \ -vendor/google.golang.org/genproto/googleapis/type/color \ -vendor/google.golang.org/genproto/googleapis/type/date \ -vendor/google.golang.org/genproto/googleapis/type/dayofweek \ -vendor/google.golang.org/genproto/googleapis/type/expr \ -vendor/google.golang.org/genproto/googleapis/type/fraction \ -vendor/google.golang.org/genproto/googleapis/type/latlng \ -vendor/google.golang.org/genproto/googleapis/type/money \ -vendor/google.golang.org/genproto/googleapis/type/postaladdress \ -vendor/google.golang.org/genproto/googleapis/type/quaternion \ -vendor/google.golang.org/genproto/googleapis/type/timeofday - +_GO_COMMON_GOOGLE_APIS = \ +vendor/google.golang.org/genproto/googleapis/api/annotations \ +vendor/google.golang.org/genproto/googleapis/api/configchange \ +vendor/google.golang.org/genproto/googleapis/api/distribution \ +vendor/google.golang.org/genproto/googleapis/api/expr/v1alpha1 \ +vendor/google.golang.org/genproto/googleapis/api/expr/v1beta1 \ +vendor/google.golang.org/genproto/googleapis/api/httpbody \ +vendor/google.golang.org/genproto/googleapis/api/label \ +vendor/google.golang.org/genproto/googleapis/api/metric \ +vendor/google.golang.org/genproto/googleapis/api/monitoredres \ +vendor/google.golang.org/genproto/googleapis/api/serviceconfig \ +vendor/google.golang.org/genproto/googleapis/api/servicecontrol/v1 \ +vendor/google.golang.org/genproto/googleapis/api/servicemanagement/v1 \ +vendor/google.golang.org/genproto/googleapis/iam/admin/v1 \ +vendor/google.golang.org/genproto/googleapis/iam/credentials/v1 \ +vendor/google.golang.org/genproto/googleapis/iam/v1 \ +vendor/google.golang.org/genproto/googleapis/iam/v1/logging \ +vendor/google.golang.org/genproto/googleapis/logging/type \ +vendor/google.golang.org/genproto/googleapis/logging/v2 \ +vendor/google.golang.org/genproto/googleapis/rpc/code \ +vendor/google.golang.org/genproto/googleapis/rpc/errdetails \ +vendor/google.golang.org/genproto/googleapis/rpc/status \ +vendor/google.golang.org/genproto/googleapis/type/calendarperiod \ +vendor/google.golang.org/genproto/googleapis/type/color \ +vendor/google.golang.org/genproto/googleapis/type/date \ +vendor/google.golang.org/genproto/googleapis/type/dayofweek \ +vendor/google.golang.org/genproto/googleapis/type/expr \ +vendor/google.golang.org/genproto/googleapis/type/fraction \ +vendor/google.golang.org/genproto/googleapis/type/latlng \ +vendor/google.golang.org/genproto/googleapis/type/money \ +vendor/google.golang.org/genproto/googleapis/type/postaladdress \ +vendor/google.golang.org/genproto/googleapis/type/quaternion \ +vendor/google.golang.org/genproto/googleapis/type/timeofday + # tag:go-specific -_COMMON_GOOGLE_APIS=None - +_COMMON_GOOGLE_APIS=None + # tag:go-specific ### @usage: USE_COMMON_GOOGLE_APIS([apis...]) -### +### ### Use common-google-apis library set. Pass optional apis list to be used or use them all. ### This macro is properly handled for all languages including Go, where apis come in ## pregenerated form. In other languages apis are generated from sources in Arcadia. -macro USE_COMMON_GOOGLE_APIS(APIS...) { - SET(_COMMON_GOOGLE_APIS ${pre=vendor/google.golang.org/genproto/googleapis/:APIS}) -} - +macro USE_COMMON_GOOGLE_APIS(APIS...) { + SET(_COMMON_GOOGLE_APIS ${pre=vendor/google.golang.org/genproto/googleapis/:APIS}) +} + # tag:go-specific tag:proto -GO_PROTO_GEN_TOOL=$_TOOL_PROTOC_GEN_GO -GO_PROTO_GEN_PLUGINS= -GO_PROTO_PACKAGE_MAP= -GO_PROTO_OPTS=$_GO_PROTOC_PLUGIN_ARGS_BASE(go $GO_PROTO_GEN_TOOL MAP $GO_PROTO_PACKAGE_MAP PLUGINS $GO_PROTO_GEN_PLUGINS) -GO_PROTO_OUTS= - +GO_PROTO_GEN_TOOL=$_TOOL_PROTOC_GEN_GO +GO_PROTO_GEN_PLUGINS= +GO_PROTO_PACKAGE_MAP= +GO_PROTO_OPTS=$_GO_PROTOC_PLUGIN_ARGS_BASE(go $GO_PROTO_GEN_TOOL MAP $GO_PROTO_PACKAGE_MAP PLUGINS $GO_PROTO_GEN_PLUGINS) +GO_PROTO_OUTS= + # tag:go-specific tag:proto GO_PROTOBUF_IMPORTS=\ ${GOSTD}/sync \ @@ -780,7 +780,7 @@ GO_PROTOBUF_IMPORTS=\ vendor/google.golang.org/protobuf/reflect/protoreflect # tag:go-specific tag:proto -GO_PROTOBUF_WELLKNOWN_TYPES=\ +GO_PROTOBUF_WELLKNOWN_TYPES=\ vendor/google.golang.org/protobuf/types/known/anypb \ vendor/google.golang.org/protobuf/types/known/apipb \ vendor/google.golang.org/protobuf/types/known/durationpb \ @@ -791,48 +791,48 @@ GO_PROTOBUF_WELLKNOWN_TYPES=\ vendor/google.golang.org/protobuf/types/known/timestamppb \ vendor/google.golang.org/protobuf/types/known/typepb \ vendor/google.golang.org/protobuf/types/known/wrapperspb - + # tag:go-specific tag:proto -### @usage: GO_PROTO_PLUGIN(Name Ext Tool [DEPS dependencies...]) -### -### Define protoc plugin for GO with given Name that emits extra output with provided extension -### Ext using Tool. Extra dependencies are passed via DEPS. -macro GO_PROTO_PLUGIN(NAME, EXT, TOOL, DEPS[]) { - SET_APPEND(GO_PROTO_OPTS $_PROTO_PLUGIN_ARGS_BASE($NAME $TOOL)) - SET_APPEND(GO_PROTO_OUTS \${output;hide;noauto;norel;nopath;noext;suf=$EXT:File}) - PEERDIR(${DEPS}) -} - +### @usage: GO_PROTO_PLUGIN(Name Ext Tool [DEPS dependencies...]) +### +### Define protoc plugin for GO with given Name that emits extra output with provided extension +### Ext using Tool. Extra dependencies are passed via DEPS. +macro GO_PROTO_PLUGIN(NAME, EXT, TOOL, DEPS[]) { + SET_APPEND(GO_PROTO_OPTS $_PROTO_PLUGIN_ARGS_BASE($NAME $TOOL)) + SET_APPEND(GO_PROTO_OUTS \${output;hide;noauto;norel;nopath;noext;suf=$EXT:File}) + PEERDIR(${DEPS}) +} + # tag:go-specific tag:proto -macro _GO_PROTOC_PLUGIN_ARGS_BASE_IMPL(Name, Tool, PLUGINS...) { +macro _GO_PROTOC_PLUGIN_ARGS_BASE_IMPL(Name, Tool, PLUGINS...) { .CMD=--plugin=protoc-gen-${Name}=${tool:Tool} --${Name}_out=${join=|:PLUGINS}:${ARCADIA_BUILD_ROOT}/$PROTO_NAMESPACE -} +} # tag:go-specific tag:proto -macro _GO_PROTOC_PLUGIN_ARGS_BASE_PROXY(Name, Tool, MAP[], PLUGINS[]) { - .CMD=$_GO_PROTOC_PLUGIN_ARGS_BASE_IMPL($Name $Tool $MAP ${pre=plugins=:PLUGINS}) -} - +macro _GO_PROTOC_PLUGIN_ARGS_BASE_PROXY(Name, Tool, MAP[], PLUGINS[]) { + .CMD=$_GO_PROTOC_PLUGIN_ARGS_BASE_IMPL($Name $Tool $MAP ${pre=plugins=:PLUGINS}) +} + # tag:go-specific tag:proto -macro _GO_PROTOC_PLUGIN_ARGS_BASE(Name, Tool, MAP[], PLUGINS[]) { - .CMD=$_GO_PROTOC_PLUGIN_ARGS_BASE_PROXY($Name $Tool MAP ${pre=M:MAP} PLUGINS ${join=|:PLUGINS}) -} - +macro _GO_PROTOC_PLUGIN_ARGS_BASE(Name, Tool, MAP[], PLUGINS[]) { + .CMD=$_GO_PROTOC_PLUGIN_ARGS_BASE_PROXY($Name $Tool MAP ${pre=M:MAP} PLUGINS ${join=|:PLUGINS}) +} + # tag:go-specific tag:proto GO_PROTO_CMDLINE=${cwd;rootdir;input:File} $YMAKE_PYTHON ${input:"build/scripts/go_proto_wrapper.py"} $GO_ARCADIA_PROJECT_PREFIX $GO_CONTRIB_PROJECT_PREFIX ./$PROTO_NAMESPACE $PROTOC -I=./$PROTO_NAMESPACE -I=$ARCADIA_ROOT/$PROTO_NAMESPACE ${pre=-I=:_PROTO__INCLUDE} -I=$ARCADIA_BUILD_ROOT -I=$PROTOBUF_PATH ${input;rootrel:File} - + # tag:go-specific tag:proto macro _GO_PROTO_CMD_IMPL(File, OPTS[], OUTS[]) { - .CMD=$GO_PROTO_CMDLINE $OPTS $OUTS ${kv;hide:"p PB"} ${kv;hide:"pc yellow"} + .CMD=$GO_PROTO_CMDLINE $OPTS $OUTS ${kv;hide:"p PB"} ${kv;hide:"pc yellow"} .PEERDIR=${GO_PROTOBUF_IMPORTS} ${GO_PROTOBUF_WELLKNOWN_TYPES} .ADDINCL=FOR proto contrib/libs/protobuf/src -} - +} + # tag:go-specific tag:proto -macro _GO_PROTO_CMD(File) { - .CMD=$_GO_PROTO_CMD_IMPL($File OPTS $GO_PROTO_OPTS OUTS $GO_PROTO_OUTS) -} - +macro _GO_PROTO_CMD(File) { + .CMD=$_GO_PROTO_CMD_IMPL($File OPTS $GO_PROTO_OPTS OUTS $GO_PROTO_OUTS) +} + # tag:proto ### @usage: YP_PROTO_YSON(Files... OUT_OPTS Opts...) ### @@ -899,7 +899,7 @@ macro _PY_PROTO_CMD_BASE(File, Suf, Args...) { # tag:proto tag:python-specific macro _PY_PROTO_CMD(File) { .CMD=${cwd;rootdir;input:File} $_PY_PROTO_CMD_BASE($File _pb2.py $PY_PROTO_OPTS $PY_PROTO_OUTS $PY_PROTO_MYPY_PLUGIN) -} +} # tag:proto tag:python-specific macro _PY_PROTO_CMD_INTERNAL(File) { @@ -935,7 +935,7 @@ otherwise { # tag:proto tag:java-specific macro _JAVA_PROTO_CMD(File) { .CMD=${cwd;rootdir;input:File} $YMAKE_PYTHON ${input:"build/scripts/tared_protoc.py"} --tar-output ${output;norel;nopath;noext;suf=.jsrc:File} --protoc-out-dir $ARCADIA_BUILD_ROOT/java_out $PROTOC -I=./$PROTO_NAMESPACE ${pre=-I=:_PROTO__INCLUDE} -I=$ARCADIA_ROOT $_JAVA_PROTO_OUT_ARG$ARCADIA_BUILD_ROOT/java_out ${input;rootrel:File} ${kv;hide:"p PB"} ${kv;hide:"pc yellow"} $JAVA_PROTO_ARGS -} +} # tag:proto tag:perl-specific tag:deprecated @@ -943,24 +943,24 @@ macro _JAVA_PROTO_CMD(File) { ### ### Generate Perl code from protobuf. ### In order to use this macro one should predict all outputs protoc will emit from input_proto file and enlist those as outputs. -macro XS_PROTO(File, Dir, Outputs...) { +macro XS_PROTO(File, Dir, Outputs...) { .CMD=$PROTOC -I=${ARCADIA_ROOT}/${Dir} ${pre=-I=:_PROTO__INCLUDE} -I=${ARCADIA_ROOT} -I=${PROTOBUF_PATH} --perlxs_out=${BINDIR} ${input:File} ${hide;output:Outputs} ${output_include;hide;nopath;noext;suf=.pb.h:File} - PEERDIR(${Dir}) - ADDINCL(${ARCADIA_BUILD_ROOT}/${Dir}) + PEERDIR(${Dir}) + ADDINCL(${ARCADIA_BUILD_ROOT}/${Dir}) } # tag:proto tag:fbs ### @usage: PROTO2FBS(InputProto) ### ### Produce flatbuf schema out of protobuf description. -macro PROTO2FBS(File) { +macro PROTO2FBS(File) { .CMD=${cwd:BINDIR} ${tool:"contrib/tools/flatc"} -I . -I ${ARCADIA_ROOT} --proto ${input:File} ${output;hide;nopath;noext:File.fbs} ${kv;hide:"p FBS"} ${kv;hide:"pc yellow"} -} +} # tag:proto tag:python-specific -when ($PY_PROTOS_FOR == "yes") { - PEERDIR+=contrib/libs/protobuf/python -} +when ($PY_PROTOS_FOR == "yes") { + PEERDIR+=contrib/libs/protobuf/python +} # tag:python-specific macro _PY_EVLOG_CMD_BASE(File, Suf, Args...) { @@ -988,9 +988,9 @@ macro _JAVA_EVLOG_CMD(File) { RUN_NO_SANITIZE=$YMAKE_PYTHON ${input:"build/scripts/run_tool.py"} -- # tag:sanitize -when ($IS_CROSS_SANITIZE) { - RUN_NO_SANITIZE= -} +when ($IS_CROSS_SANITIZE) { + RUN_NO_SANITIZE= +} YIELD=$YMAKE_PYTHON ${input:"build/scripts/yield_line.py"} -- ${BINDIR}/__args XARGS=$YMAKE_PYTHON ${input:"build/scripts/xargs.py"} -- ${BINDIR}/__args @@ -1000,15 +1000,15 @@ RESPFILE_CMD=$YMAKE_PYTHON ${input:"build/scripts/writer.py"} FS_TOOLS=$YMAKE_PYTHON ${input:"build/scripts/fs_tools.py"} COPY_CMD=$FS_TOOLS copy -LINK_OR_COPY_CMD=$FS_TOOLS link_or_copy +LINK_OR_COPY_CMD=$FS_TOOLS link_or_copy REMOVE_FILE=$FS_TOOLS remove MOVE_FILE=$FS_TOOLS rename # tag:allocator tag:windows-specific MSVC_DYNAMICBASE=/DYNAMICBASE -when ($ALLOCATOR == "LF") { - MSVC_DYNAMICBASE=/DYNAMICBASE:NO -} +when ($ALLOCATOR == "LF") { + MSVC_DYNAMICBASE=/DYNAMICBASE:NO +} # tag:sanitize SANITIZER_CFLAGS= @@ -1018,7 +1018,7 @@ SANITIZER_CFLAGS= ### ### Emit GRPC code for all .proto files in a PROTO_LIBRARY. ### This works for all available PROTO_LIBRARY versions (C++, Python 2.x, Pyton 3.x, Java and Go). -macro GRPC() { +macro GRPC() { # C++ CPP_PROTO_PLUGIN2(grpc_cpp contrib/tools/protoc/plugins/grpc_cpp .grpc.pb.cc .grpc.pb.h DEPS contrib/libs/grpc) @@ -1030,70 +1030,70 @@ macro GRPC() { } # tag:fbs -FLATC_FLAGS_VALUE= -### @usage: FLATC_FLAGS(flags...) -### -### Add flags to flatc command line -macro FLATC_FLAGS(FLAGS...) { - SET_APPEND(FLATC_FLAGS_VALUE $FLAGS) -} +FLATC_FLAGS_VALUE= +### @usage: FLATC_FLAGS(flags...) +### +### Add flags to flatc command line +macro FLATC_FLAGS(FLAGS...) { + SET_APPEND(FLATC_FLAGS_VALUE $FLAGS) +} # tag:fbs -_PY_FBS_DEPS=contrib/python/flatbuffers - +_PY_FBS_DEPS=contrib/python/flatbuffers + # tag:fbs tag:internal -### @usage: FBS_TO_PYSRC(output_base_name fbs_files...) # internal -### -### Create a tar archive of .py files generated by flatc for Python. Output tar -### archive will have .fbs.pysrc extension. This .fbs.pysrc extension is specially -### processed when --add-flatbuf-result flag is specified on the command line -### for 'ya make ...' (tar archive is extracted to output directory). -macro FBS_TO_PYSRC(OUT_NAME, IN_FBS_FILES...) { - .CMD=${cwd:ARCADIA_BUILD_ROOT} ${tool:"contrib/tools/flatc"} --python --gen-mutable ${FLATC_FLAGS_VALUE} ${pre=-I :_FLATC__INCLUDE} -o ${BINDIR} ${input:IN_FBS_FILES} && $YMAKE_PYTHON ${input:"build/scripts/tar_sources.py"} --exts .py --input $BINDIR --output ${output;noauto;tared:OUT_NAME.fbs.pysrc} ${kv;hide:"p FP"} ${kv;hide:"pc light-green"} ${kv;hide:"tared_kind nodir"} -} - +### @usage: FBS_TO_PYSRC(output_base_name fbs_files...) # internal +### +### Create a tar archive of .py files generated by flatc for Python. Output tar +### archive will have .fbs.pysrc extension. This .fbs.pysrc extension is specially +### processed when --add-flatbuf-result flag is specified on the command line +### for 'ya make ...' (tar archive is extracted to output directory). +macro FBS_TO_PYSRC(OUT_NAME, IN_FBS_FILES...) { + .CMD=${cwd:ARCADIA_BUILD_ROOT} ${tool:"contrib/tools/flatc"} --python --gen-mutable ${FLATC_FLAGS_VALUE} ${pre=-I :_FLATC__INCLUDE} -o ${BINDIR} ${input:IN_FBS_FILES} && $YMAKE_PYTHON ${input:"build/scripts/tar_sources.py"} --exts .py --input $BINDIR --output ${output;noauto;tared:OUT_NAME.fbs.pysrc} ${kv;hide:"p FP"} ${kv;hide:"pc light-green"} ${kv;hide:"tared_kind nodir"} +} + # tag:fbs tag:go-specific -# Implicit dependencies of generated code for Go -_GO_FLATC_IMPORTS=\ - ${GOSTD}/strconv \ - vendor/github.com/google/flatbuffers/go - +# Implicit dependencies of generated code for Go +_GO_FLATC_IMPORTS=\ + ${GOSTD}/strconv \ + vendor/github.com/google/flatbuffers/go + # tag:fbs tag:cpp-specific -macro _CPP_FLATC_CMD(SRC, SRCFLAGS...) { - .CMD=${cwd:ARCADIA_BUILD_ROOT} $YMAKE_PYTHON ${input:"build/scripts/cpp_flatc_wrapper.py"} ${tool:"contrib/tools/flatc"} --no-warnings --cpp --keep-prefix --gen-mutable --schema -b --yandex-maps-iter --gen-object-api --filename-suffix .fbs ${FLATC_FLAGS_VALUE} ${pre=-I :_FLATC__INCLUDE} -o ${output;norel:SRC.h} ${output;hide;norel:SRC.cpp} ${input:SRC} ${output;hide;noext;norel:SRC.iter.fbs.h} ${output;noauto;hide;noext;norel:SRC.bfbs} ${kv;hide:"p FL"} ${kv;hide:"pc light-green"} - .PEERDIR=contrib/libs/flatbuffers -} - +macro _CPP_FLATC_CMD(SRC, SRCFLAGS...) { + .CMD=${cwd:ARCADIA_BUILD_ROOT} $YMAKE_PYTHON ${input:"build/scripts/cpp_flatc_wrapper.py"} ${tool:"contrib/tools/flatc"} --no-warnings --cpp --keep-prefix --gen-mutable --schema -b --yandex-maps-iter --gen-object-api --filename-suffix .fbs ${FLATC_FLAGS_VALUE} ${pre=-I :_FLATC__INCLUDE} -o ${output;norel:SRC.h} ${output;hide;norel:SRC.cpp} ${input:SRC} ${output;hide;noext;norel:SRC.iter.fbs.h} ${output;noauto;hide;noext;norel:SRC.bfbs} ${kv;hide:"p FL"} ${kv;hide:"pc light-green"} + .PEERDIR=contrib/libs/flatbuffers +} + # tag:fbs tag:cpp-specific -macro _CPP_FLATC64_CMD(SRC, SRCFLAGS...) { - .CMD=${cwd:ARCADIA_BUILD_ROOT} $YMAKE_PYTHON ${input:"build/scripts/cpp_flatc_wrapper.py"} ${tool:"contrib/tools/flatc64"} --no-warnings --cpp --keep-prefix --gen-mutable --schema -b --filename-suffix .fbs64 ${FLATC_FLAGS_VALUE} -I ${ARCADIA_ROOT} -I ${ARCADIA_BUILD_ROOT} -o ${output;norel:SRC.h} ${output;hide;norel:SRC.cpp} ${input:SRC} ${output;noauto;hide;noext;norel:SRC.bfbs64} ${kv;hide:"p FL64"} ${kv;hide:"pc light-green"} - .PEERDIR=contrib/libs/flatbuffers64 -} - +macro _CPP_FLATC64_CMD(SRC, SRCFLAGS...) { + .CMD=${cwd:ARCADIA_BUILD_ROOT} $YMAKE_PYTHON ${input:"build/scripts/cpp_flatc_wrapper.py"} ${tool:"contrib/tools/flatc64"} --no-warnings --cpp --keep-prefix --gen-mutable --schema -b --filename-suffix .fbs64 ${FLATC_FLAGS_VALUE} -I ${ARCADIA_ROOT} -I ${ARCADIA_BUILD_ROOT} -o ${output;norel:SRC.h} ${output;hide;norel:SRC.cpp} ${input:SRC} ${output;noauto;hide;noext;norel:SRC.bfbs64} ${kv;hide:"p FL64"} ${kv;hide:"pc light-green"} + .PEERDIR=contrib/libs/flatbuffers64 +} + # tag:fbs tag:go-specific tag:internal -### @usage: _GO_FLATC_CMD(fbs_file flags...) # internal -### -### Create a tar archive of .go files generated by flatc for Go. Output tar archive -### wiil have .fbs.gosrc extension. This .fbs.gosrc is specially processed when -### --add-protobuf-result flag is specified on the command line for 'ya make ...' -### (tar archive is extracted to output directory). -macro _GO_FLATC_CMD(SRC, PACKAGE_NAME) { - .CMD=${cwd:ARCADIA_BUILD_ROOT} ${tool:"contrib/tools/flatc"} --go --gen-mutable --go-namespace ${PACKAGE_NAME} ${FLATC_FLAGS_VALUE} ${pre=-I :_FLATC__INCLUDE} -o ${BINDIR}/_generated ${input:SRC} && $YMAKE_PYTHON ${input:"build/scripts/postprocess_go_fbs.py"} --input-dir ${BINDIR} --map $_FBS_NAMESPACE_MAP_GLOBAL && $YMAKE_PYTHON ${input:"build/scripts/tar_sources.py"} --flat --input ${BINDIR}/_generated --output ${output;noext;tared:SRC.fbs.gosrc} --exts .go ${kv;hide:"p FG"} ${kv;hide:"pc light-green"} ${kv;hide:"tared_kind nodir"} - .PEERDIR=${_GO_FLATC_IMPORTS} -} - +### @usage: _GO_FLATC_CMD(fbs_file flags...) # internal +### +### Create a tar archive of .go files generated by flatc for Go. Output tar archive +### wiil have .fbs.gosrc extension. This .fbs.gosrc is specially processed when +### --add-protobuf-result flag is specified on the command line for 'ya make ...' +### (tar archive is extracted to output directory). +macro _GO_FLATC_CMD(SRC, PACKAGE_NAME) { + .CMD=${cwd:ARCADIA_BUILD_ROOT} ${tool:"contrib/tools/flatc"} --go --gen-mutable --go-namespace ${PACKAGE_NAME} ${FLATC_FLAGS_VALUE} ${pre=-I :_FLATC__INCLUDE} -o ${BINDIR}/_generated ${input:SRC} && $YMAKE_PYTHON ${input:"build/scripts/postprocess_go_fbs.py"} --input-dir ${BINDIR} --map $_FBS_NAMESPACE_MAP_GLOBAL && $YMAKE_PYTHON ${input:"build/scripts/tar_sources.py"} --flat --input ${BINDIR}/_generated --output ${output;noext;tared:SRC.fbs.gosrc} --exts .go ${kv;hide:"p FG"} ${kv;hide:"pc light-green"} ${kv;hide:"tared_kind nodir"} + .PEERDIR=${_GO_FLATC_IMPORTS} +} + # tag:fbs tag:java-specific tag:internal -### @usage: _JAVA_FLATC_CMD(fbs_file) # internal -### -### Create a tar archive of .java files generated by flatc for Java. Output tar -### acrchive will have .fbs.jsrc extension. Files with .fbs.jsrc extension will -### be added to results when --add-flatbuf-result flag is specified on the command -### line for 'ya make ...' -macro _JAVA_FLATC_CMD(SRC) { - .CMD=${cwd:ARCADIA_BUILD_ROOT} ${tool:"contrib/tools/flatc"} --java --gen-mutable ${FLATC_FLAGS_VALUE} ${pre=-I :_FLATC__INCLUDE} -o ${BINDIR} ${input:SRC} && $YMAKE_PYTHON ${input:"build/scripts/tar_sources.py"} --input $BINDIR --output ${output;nopath;noext:SRC.fbs.jsrc} --exts .java ${kv;hide:"p FJ"} ${kv;hide:"pc light-green"} - .PEERDIR=contrib/java/com/google/flatbuffers/flatbuffers-java/${JAVA_FLATBUFFERS_VERSION} -} - +### @usage: _JAVA_FLATC_CMD(fbs_file) # internal +### +### Create a tar archive of .java files generated by flatc for Java. Output tar +### acrchive will have .fbs.jsrc extension. Files with .fbs.jsrc extension will +### be added to results when --add-flatbuf-result flag is specified on the command +### line for 'ya make ...' +macro _JAVA_FLATC_CMD(SRC) { + .CMD=${cwd:ARCADIA_BUILD_ROOT} ${tool:"contrib/tools/flatc"} --java --gen-mutable ${FLATC_FLAGS_VALUE} ${pre=-I :_FLATC__INCLUDE} -o ${BINDIR} ${input:SRC} && $YMAKE_PYTHON ${input:"build/scripts/tar_sources.py"} --input $BINDIR --output ${output;nopath;noext:SRC.fbs.jsrc} --exts .java ${kv;hide:"p FJ"} ${kv;hide:"pc light-green"} + .PEERDIR=contrib/java/com/google/flatbuffers/flatbuffers-java/${JAVA_FLATBUFFERS_VERSION} +} + # variables must be defined for all module types to make generate_mf.py work MODULE_PREFIX= MODULE_SUFFIX= @@ -1119,11 +1119,11 @@ when (!$ARCADIA_PYTHON_UNICODE_SIZE) { ### The base of all modules describing default bare minimum for all modules. ### To avoid surprises, all buildable modules are better to be inherited from it or its descendants. module _BARE_UNIT { - .EXTS=.* - .CMD=TOUCH_UNIT - .IGNORED=GO_PROTO_PLUGIN - .NODE_TYPE=Bundle - .PEERDIR_POLICY=as_include + .EXTS=.* + .CMD=TOUCH_UNIT + .IGNORED=GO_PROTO_PLUGIN + .NODE_TYPE=Bundle + .PEERDIR_POLICY=as_include .RESTRICTED=GRPC USE_SKIFF INDUCED_DEPS FUZZ_DICTS FUZZ_OPTS PACK DOCS_DIR DOCS_CONFIG DOCS_VARS YT_SPEC USE_CXX USE_UTIL WHOLE_ARCHIVE PRIMARY_OUTPUT SECONDARY_OUTPUT DEPENDENCY_MANAGEMENT EXCLUDE NO_DOCTESTS EMBED_JAVA_VCS_INFO RESOURCE_FILES PACK_GLOBALS_IN_LIBRARY EXPOSE GLOBAL_DEPS .FINAL_TARGET=no @@ -1146,50 +1146,50 @@ module _BASE_UNIT: _BARE_UNIT { .GLOBAL=_FBS_NAMESPACE_MAP PEERDIR_TAGS=CPP_PROTO CPP_FBS CPP_SSQLS CPP_IDL PY2 PY2_NATIVE YQL_UDF_STATIC __EMPTY__ DLL_LIB - + CPP_PROTO_CMDLINE=${cwd;rootdir;input:File} $PROTOC -I=./$PROTO_NAMESPACE -I=$ARCADIA_ROOT/$PROTO_NAMESPACE ${pre=-I=:_PROTO__INCLUDE} -I=$ARCADIA_BUILD_ROOT -I=$PROTOBUF_PATH --cpp_out=${CPP_PROTO_PLUGINS}$ARCADIA_BUILD_ROOT/$PROTO_NAMESPACE $PROTOC_STYLEGUIDE_OUT $PROTOC_PLUGIN_STYLEGUIDE ${input;rootrel:File} CPP_PROTO_OUTS+=${output;hide;norel;nopath;noext:File.pb.cc} ${output;main;hide;norel;nopath;noext:File.pb.h} CPP_EV_OUTS+=${output;hide;norel:File.pb.cc} ${output;hide;norel:File.pb.h} - when ($PY_PROTOS_FOR == "yes") { + when ($PY_PROTOS_FOR == "yes") { MACRO_ALIAS(EVLOG_CMD _PY_EVLOG_CMD) MACRO_ALIAS(PROTO_CMD _PY_PROTO_CMD) - } - otherwise { + } + otherwise { MACRO_ALIAS(EVLOG_CMD _CPP_EVLOG_CMD) - MACRO_ALIAS(FBS_CMD _CPP_FLATC_CMD) + MACRO_ALIAS(FBS_CMD _CPP_FLATC_CMD) when ($BUILD_PROTO_AS_EVLOG == "yes") { MACRO_ALIAS(PROTO_CMD _CPP_PROTO_EVLOG_CMD) } otherwise { MACRO_ALIAS(PROTO_CMD _CPP_PROTO_CMD) } - when ($USE_VANILLA_PROTOC == "yes") { - PROTOC=${tool:"contrib/tools/protoc_std"} - PROTOC_STYLEGUIDE_OUT= - PROTOC_PLUGIN_STYLEGUIDE= - PROTOBUF_PATH=${ARCADIA_ROOT}/contrib/libs/protobuf_std - MACRO_ALIAS(PROTO_CMD _CPP_VANILLA_PROTO_CMD) - } - } + when ($USE_VANILLA_PROTOC == "yes") { + PROTOC=${tool:"contrib/tools/protoc_std"} + PROTOC_STYLEGUIDE_OUT= + PROTOC_PLUGIN_STYLEGUIDE= + PROTOBUF_PATH=${ARCADIA_ROOT}/contrib/libs/protobuf_std + MACRO_ALIAS(PROTO_CMD _CPP_VANILLA_PROTO_CMD) + } + } SANITIZER_DEFINED=no when ($SANITIZER_TYPE && $SANITIZER_TYPE != "no") { CFLAGS+=-fsanitize=$SANITIZER_TYPE -D${SANITIZER_TYPE}_sanitizer_enabled $SANITIZER_CFLAGS -fno-omit-frame-pointer LDFLAGS+=-fsanitize=$SANITIZER_TYPE - SANITIZER_DEFINED=yes + SANITIZER_DEFINED=yes when ($CLANG) { CFLAGS+=-fsanitize-blacklist=${input:"build/sanitize-blacklist.txt"} LDFLAGS+=-fsanitize-blacklist=${input:"build/sanitize-blacklist.txt"} } - } + } - when ($SANITIZE_COVERAGE && $SANITIZE_COVERAGE != "no") { - CFLAGS+=-fsanitize-coverage=$SANITIZE_COVERAGE - LDFLAGS+=-fsanitize-coverage=$SANITIZE_COVERAGE - } + when ($SANITIZE_COVERAGE && $SANITIZE_COVERAGE != "no") { + CFLAGS+=-fsanitize-coverage=$SANITIZE_COVERAGE + LDFLAGS+=-fsanitize-coverage=$SANITIZE_COVERAGE + } when ($CLANG_COVERAGE && $CLANG_COVERAGE != "no") { CFLAGS+=-fprofile-instr-generate -fcoverage-mapping -DCLANG_COVERAGE @@ -1200,20 +1200,20 @@ module _BASE_UNIT: _BARE_UNIT { CFLAGS+=-DNLG_COVERAGE } - when ($GCC) { - select ($SANITIZER_TYPE) { - "address" ? { - LDFLAGS+=-static-libasan - } - "undefined" ? { - LDFLAGS+=-static-libubsan - } - "thread" ? { + when ($GCC) { + select ($SANITIZER_TYPE) { + "address" ? { + LDFLAGS+=-static-libasan + } + "undefined" ? { + LDFLAGS+=-static-libubsan + } + "thread" ? { PIE=yes LDFLAGS+=-static-libtsan - } - } - } + } + } + } when ($HARDENING == "yes") { when ($CLANG) { @@ -1223,16 +1223,16 @@ module _BASE_UNIT: _BARE_UNIT { } } - when ($USE_LTO == "yes") { - when ($GCC) { - CFLAGS+=-flto -fno-fat-lto-objects - LDFLAGS+=-flto - } - when ($CLANG) { + when ($USE_LTO == "yes") { + when ($GCC) { + CFLAGS+=-flto -fno-fat-lto-objects + LDFLAGS+=-flto + } + when ($CLANG) { CFLAGS+=-flto LDFLAGS+=-flto - } - } + } + } when ($USE_THINLTO == "yes") { when ($GCC) { @@ -1246,20 +1246,20 @@ module _BASE_UNIT: _BARE_UNIT { } - when ($CLANG) { - when ($PGO_ADD == "yes") { - CFLAGS+=-fprofile-instr-generate - LDFLAGS+=-fprofile-instr-generate - } - when ($PGO_PATH) { - CFLAGS+=-fprofile-instr-use=$PGO_PATH -Wno-profile-instr-unprofiled -Wno-profile-instr-out-of-date - LDFLAGS+=-fprofile-instr-use=$PGO_PATH - } - } + when ($CLANG) { + when ($PGO_ADD == "yes") { + CFLAGS+=-fprofile-instr-generate + LDFLAGS+=-fprofile-instr-generate + } + when ($PGO_PATH) { + CFLAGS+=-fprofile-instr-use=$PGO_PATH -Wno-profile-instr-unprofiled -Wno-profile-instr-out-of-date + LDFLAGS+=-fprofile-instr-use=$PGO_PATH + } + } when ($COMPILER_PLATFORM && $NEED_PLATFORM_PEERDIRS == "yes") { - PEERDIR+=$COMPILER_PLATFORM - } + PEERDIR+=$COMPILER_PLATFORM + } when ($OS_LINUX && $NEED_PLATFORM_PEERDIRS == "yes") { PEERDIR+=contrib/libs/linux-headers @@ -1288,21 +1288,21 @@ module _BASE_UNIT: _BARE_UNIT { PEERDIR+=util } - when ($MUSL == "yes") { + when ($MUSL == "yes") { CFLAGS += -D_musl_ LINK_DYN_LIB_FLAGS += --musl LINK_SCRIPT_EXE_FLAGS += --musl PEERDIR+=contrib/libs/musl/include - } + } # g++ has proxy C-headers which are incompatible with libc++ proxy C-headers. # The same problem exists for clang toolchain. On the other hand, the problem # doesn't affect cl since it has united C/C++ library and doesn't need # proxy C-headers. # Disable all C++ headers including proxy C-headers when we use libc++. - when ($USE_INTERNAL_STL == "yes" && $MSVC != "yes") { - CXXFLAGS += -nostdinc++ - } + when ($USE_INTERNAL_STL == "yes" && $MSVC != "yes") { + CXXFLAGS += -nostdinc++ + } when ($CODENAVIGATION && $NOCODENAVIGATION != "yes") { PEERDIR += build/external_resources/codenavigation @@ -1334,8 +1334,8 @@ module _BASE_UNIT: _BARE_UNIT { _REGISTER_NO_CHECK_IMPORTS() - DEFAULT(PACKAGE_PREFIX_ARGS) - + DEFAULT(PACKAGE_PREFIX_ARGS) + DEFAULT(BYACC_FLAGS -v) DEFAULT(SWIG_LANG python) DEFAULT(BISON_FLAGS -v) @@ -1346,44 +1346,44 @@ module _BASE_UNIT: _BARE_UNIT { } } -_LINKER_ID= -# GCC does not support -fuse-ld with an executable path, only -# -fuse-ld=bfd or -fuse-ld=gold (or -fuse-ld=lld in later versions). -when ($_LINKER_ID != "" && $_DEFAULT_LINKER_ID != "" && $CLANG == "yes" && $NEED_PLATFORM_PEERDIRS == "yes") { - when ($_LINKER_ID in [ "bfd", "gold", "lld" ]) { - PEERDIR+=build/platform/${_LINKER_ID} - } -} - -macro _USE_LINKER_IMPL(LINKER_ID...) { - SET(_LINKER_ID $LINKER_ID) -} - -macro _USE_LINKER() { - _USE_LINKER_IMPL($_DEFAULT_LINKER_ID) -} - -### @usage: USE_LINKER_BFD() -### Use bfd linker for a program. This doesn't work in libraries -macro USE_LINKER_BFD() { - _USE_LINKER_IMPL(bfd) -} -### @usage: USE_LINKER_GOLD() -### Use gold linker for a program. This doesn't work in libraries -macro USE_LINKER_GOLD() { - _USE_LINKER_IMPL(gold) -} -### @usage: USE_LINKER_LLD() -### Use lld linker for a program. This doesn't work in libraries -macro USE_LINKER_LLD() { - _USE_LINKER_IMPL(lld) -} - -COMMON_LINK_SETTINGS= +_LINKER_ID= +# GCC does not support -fuse-ld with an executable path, only +# -fuse-ld=bfd or -fuse-ld=gold (or -fuse-ld=lld in later versions). +when ($_LINKER_ID != "" && $_DEFAULT_LINKER_ID != "" && $CLANG == "yes" && $NEED_PLATFORM_PEERDIRS == "yes") { + when ($_LINKER_ID in [ "bfd", "gold", "lld" ]) { + PEERDIR+=build/platform/${_LINKER_ID} + } +} + +macro _USE_LINKER_IMPL(LINKER_ID...) { + SET(_LINKER_ID $LINKER_ID) +} + +macro _USE_LINKER() { + _USE_LINKER_IMPL($_DEFAULT_LINKER_ID) +} + +### @usage: USE_LINKER_BFD() +### Use bfd linker for a program. This doesn't work in libraries +macro USE_LINKER_BFD() { + _USE_LINKER_IMPL(bfd) +} +### @usage: USE_LINKER_GOLD() +### Use gold linker for a program. This doesn't work in libraries +macro USE_LINKER_GOLD() { + _USE_LINKER_IMPL(gold) +} +### @usage: USE_LINKER_LLD() +### Use lld linker for a program. This doesn't work in libraries +macro USE_LINKER_LLD() { + _USE_LINKER_IMPL(lld) +} + +COMMON_LINK_SETTINGS= LINK_ADDITIONAL_SECTIONS= LINK_ADDITIONAL_SECTIONS_COMMAND= -when ($COMMON_LINK_SETTINGS == "yes") { +when ($COMMON_LINK_SETTINGS == "yes") { when ($_LINKER_ID == "lld" || $_LINKER_ID == "gold") { LDFLAGS += -Wl,--gdb-index } @@ -1404,28 +1404,28 @@ when ($COMMON_LINK_SETTINGS == "yes") { LDFLAGS+=-Wl,-Map=${output;rootrel;pre=$MODULE_PREFIX;suf=.map.$_LINKER_ID:REALPRJNAME} } - when ($USE_MKL == "yes") { - NOPLATFORM=yes - } + when ($USE_MKL == "yes") { + NOPLATFORM=yes + } when (($USE_EAT_MY_DATA == "yes") && ($WIN32 != "yes") && ($DARWIN != "yes") && ($OS_ANDROID != "yes") && ($OS_IOS != "yes")) { PEERDIR+=contrib/libs/libeatmydata/autocheck_wrapper - } + } - when ($USE_ARCADIA_LIBM == "yes") { - PEERDIR+=contrib/libs/libm - } - when ($USE_ARCADIA_LIBM == "no") { + when ($USE_ARCADIA_LIBM == "yes") { + PEERDIR+=contrib/libs/libm + } + when ($USE_ARCADIA_LIBM == "no") { C_SYSTEM_LIBRARIES+=-lm - } + } when (($MUSL != "yes" && $WITH_VALGRIND == "yes") || $SANITIZER_DEFINED == "yes") { when ($ALLOCATOR in [ "TCMALLOC", "TCMALLOC_SMALL_BUT_SLOW", "TCMALLOC_NUMA_256K", "TCMALLOC_NUMA_LARGE_PAGES", "TCMALLOC_256K", "GOOGLE", "J", "LF", "LF_YT", "LF_DBG", "B", "BM", "C", "LOCKLESS", "YT", "MIM", "HU" ]) { PEERDIR+=library/cpp/malloc/system - } - } - otherwise { - select ($ALLOCATOR) { + } + } + otherwise { + select ($ALLOCATOR) { "MIM" ? { PEERDIR+=library/cpp/malloc/mimalloc } @@ -1452,59 +1452,59 @@ when ($COMMON_LINK_SETTINGS == "yes") { PEERDIR+=library/cpp/malloc/tcmalloc PEERDIR+=contrib/libs/tcmalloc/default } - "GOOGLE" ? { + "GOOGLE" ? { PEERDIR+=library/cpp/malloc/galloc - } - "J" ? { - when ($WIN32 == "yes") { + } + "J" ? { + when ($WIN32 == "yes") { PEERDIR+=library/cpp/malloc/system - } - otherwise { + } + otherwise { PEERDIR+=library/cpp/malloc/jemalloc - } - } - "LF" ? { + } + } + "LF" ? { PEERDIR+=library/cpp/lfalloc - } - "LF_YT" ? { + } + "LF_YT" ? { PEERDIR+=library/cpp/lfalloc/yt - } - "LF_DBG" ? { + } + "LF_DBG" ? { PEERDIR+=library/cpp/lfalloc/dbg - } - "B" ? { + } + "B" ? { PEERDIR+=library/cpp/balloc - } + } "BM" ? { PEERDIR+=library/cpp/balloc_market } "C" ? { PEERDIR+=library/cpp/malloc/calloc } - "LOCKLESS" ? { + "LOCKLESS" ? { PEERDIR+=library/cpp/malloc/lockless - } + } "YT" ? { PEERDIR+=library/cpp/ytalloc/impl } - } - } - - when ($ALLOCATOR == "SYSTEM") { + } + } + + when ($ALLOCATOR == "SYSTEM") { PEERDIR+=library/cpp/malloc/system - } + } when ($WERROR != "no") { - when ($WERROR_MODE == "all" || ($WERROR_MODE == "compiler_specific" && $WERROR == "yes")) { + when ($WERROR_MODE == "all" || ($WERROR_MODE == "compiler_specific" && $WERROR == "yes")) { C_WARNING_OPTS += $WERROR_FLAG - } - } + } + } - when ($ICC == "yes") { - PEERDIR+=contrib/libs/intel/core - } - when ($WITH_VALGRIND == "yes") { - PEERDIR+=contrib/libs/valgrind - } + when ($ICC == "yes") { + PEERDIR+=contrib/libs/intel/core + } + when ($WITH_VALGRIND == "yes") { + PEERDIR+=contrib/libs/valgrind + } } when ($EMBED_LINKER_MAP == "yes" || $EMBED_LINKER_CREF == "yes") { @@ -1535,64 +1535,64 @@ macro WITH_DYNAMIC_LIBS() { } # tag:internal -### $usage: REAL_LINK_EXE_IMPL(peers...) # internal -macro REAL_LINK_EXE_IMPL(WHOLE_ARCHIVE_PEERS...) { +### $usage: REAL_LINK_EXE_IMPL(peers...) # internal +macro REAL_LINK_EXE_IMPL(WHOLE_ARCHIVE_PEERS...) { .CMD=$REAL_LINK_EXE_CMDLINE && $LINK_OR_COPY_SO_CMD -} - +} + # tag:internal -### $usage: REAL_LINK_EXEC_DYN_LIB_IMPL(peers...) # internal -macro REAL_LINK_EXEC_DYN_LIB_IMPL(WHOLE_ARCHIVE_PEERS...) { - .CMD=$REAL_LINK_EXEC_DYN_LIB_CMDLINE -} - +### $usage: REAL_LINK_EXEC_DYN_LIB_IMPL(peers...) # internal +macro REAL_LINK_EXEC_DYN_LIB_IMPL(WHOLE_ARCHIVE_PEERS...) { + .CMD=$REAL_LINK_EXEC_DYN_LIB_CMDLINE +} + # tag:internal -### $usage: REAL_LINK_DYN_LIB_IMPL(peers...) # internal -macro REAL_LINK_DYN_LIB_IMPL(WHOLE_ARCHIVE_PEERS...) { +### $usage: REAL_LINK_DYN_LIB_IMPL(peers...) # internal +macro REAL_LINK_DYN_LIB_IMPL(WHOLE_ARCHIVE_PEERS...) { .CMD=$REAL_LINK_DYN_LIB_CMDLINE && $LINK_OR_COPY_SO_CMD -} - +} + # tag:internal -### $usage: LINK_EXE_IMPL(peers...) # internal -macro LINK_EXE_IMPL(WHOLE_ARCHIVE_PEERS...) { +### $usage: LINK_EXE_IMPL(peers...) # internal +macro LINK_EXE_IMPL(WHOLE_ARCHIVE_PEERS...) { .CMD=$LINK_EXE_CMDLINE && $LINK_OR_COPY_SO_CMD -} - +} + # tag:internal -### $usage: LINK_EXEC_DYN_LIB_IMPL(peers...) # internal -macro LINK_EXEC_DYN_LIB_IMPL(WHOLE_ARCHIVE_PEERS...) { - .CMD=$LINK_EXEC_DYN_LIB_CMDLINE -} - +### $usage: LINK_EXEC_DYN_LIB_IMPL(peers...) # internal +macro LINK_EXEC_DYN_LIB_IMPL(WHOLE_ARCHIVE_PEERS...) { + .CMD=$LINK_EXEC_DYN_LIB_CMDLINE +} + # tag:internal -### @usage: _LINK_UNIT # internal -### -### The base of all linkable modules: programs, DLLs etc. Describes common linking logic. -module _LINK_UNIT: _BASE_UNIT { +### @usage: _LINK_UNIT # internal +### +### The base of all linkable modules: programs, DLLs etc. Describes common linking logic. +module _LINK_UNIT: _BASE_UNIT { .EXTS=.o .obj .supp .tidyjson .ld - .CMD=LINK_EXE + .CMD=LINK_EXE .ALLOWED=EXTRALIBS OBJADDE_GLOBAL RESOURCE_FILES - .NODE_TYPE=Program - .PEERDIR_POLICY=as_build_from - .FINAL_TARGET=yes + .NODE_TYPE=Program + .PEERDIR_POLICY=as_build_from + .FINAL_TARGET=yes .ALIASES=RES_REQUIREMENTS=PY_REQUIREMENTS - - DEFAULT(ALLOCATOR $DEFAULT_ALLOCATOR) - _USE_LINKER() - - #link with libunwind manually - when ($DARWIN == "yes" && $NOPLATFORM != "yes") { - PEERDIR += contrib/libs/cxxsupp - } - - when ($USE_LIBCXXRT == "yes") { - PEERDIR += contrib/libs/cxxsupp/libcxxrt - } - - ENABLE(COMMON_LINK_SETTINGS) + + DEFAULT(ALLOCATOR $DEFAULT_ALLOCATOR) + _USE_LINKER() + + #link with libunwind manually + when ($DARWIN == "yes" && $NOPLATFORM != "yes") { + PEERDIR += contrib/libs/cxxsupp + } + + when ($USE_LIBCXXRT == "yes") { + PEERDIR += contrib/libs/cxxsupp/libcxxrt + } + + ENABLE(COMMON_LINK_SETTINGS) CHECK_PROVIDES() -} - +} + MODULE_TYPE=UNKNOWN macro ADD_CLANG_TIDY() { @@ -1606,27 +1606,27 @@ macro ADD_CLANG_TIDY() { ### ### The base of all programs. It adds dependencies to make final artefact complete and runnable. module _BASE_PROGRAM: _LINK_UNIT { - .SYMLINK_POLICY=EXE - .ALLOWED=INDUCED_DEPS WHOLE_ARCHIVE + .SYMLINK_POLICY=EXE + .ALLOWED=INDUCED_DEPS WHOLE_ARCHIVE .GLOBAL=LDFLAGS _WHOLE_ARCHIVE_LIBS_VALUE RPATH - SET(MODULE_TYPE PROGRAM) - + SET(MODULE_TYPE PROGRAM) + when ($OS_IOS == "yes") { EXTS+=.ios.interface } - when ($WIN32 == "yes" || $OS_CYGWIN == "yes") { - MODULE_SUFFIX=.exe - } - + when ($WIN32 == "yes" || $OS_CYGWIN == "yes") { + MODULE_SUFFIX=.exe + } + when ($TIDY == "yes") { MODULE_SUFFIX=.tidyjson } when ($MSVC != "yes" && $NOPLATFORM != "yes" && $WITH_VALGRIND != "yes" && $USE_ASMLIB != "no" && $MIC_ARCH != "yes" && $PIC != "yes" && $PIE != "yes") { - PEERDIR+=contrib/libs/asmlib - } - + PEERDIR+=contrib/libs/asmlib + } + when ($MUSL == "yes") { when ($MUSL_LITE == "yes") { PEERDIR += contrib/libs/musl @@ -1645,13 +1645,13 @@ module _BASE_PROGRAM: _LINK_UNIT { PEERDIR += library/cpp/cpuid_check } - when ($USE_ARC_PROFILE == "yes" && $NOUTIL != "yes") { + when ($USE_ARC_PROFILE == "yes" && $NOUTIL != "yes") { PEERDIR += library/cpp/execprofile/autostart - } - - when ($SANITIZER_DEFINED == "yes") { - PEERDIR += contrib/libs/cxxsupp/libsan - } + } + + when ($SANITIZER_DEFINED == "yes") { + PEERDIR += contrib/libs/cxxsupp/libsan + } when ($CLANG_COVERAGE && $CLANG_COVERAGE != "no") { PEERDIR+=library/cpp/testing/dump_clang_coverage @@ -1666,7 +1666,7 @@ module _BASE_PROGRAM: _LINK_UNIT { } } -CPP_PROGRAM_SEM=add_executable $MODDIR $REALPRJNAME ${hide:TARGET} ${hide:AUTO_INPUT} && vcs_info && target_link_flags PUBLIC $OBJADDE_LIB $OBJADDE +CPP_PROGRAM_SEM=add_executable $MODDIR $REALPRJNAME ${hide:TARGET} ${hide:AUTO_INPUT} && vcs_info && target_link_flags PUBLIC $OBJADDE_LIB $OBJADDE ### @usage: PROGRAM([progname]) ### ### Regular program module. @@ -1750,13 +1750,13 @@ multimodule PY3_PROGRAM { # tag:ycr-specific macro _YCR_GENERATE_CONFIGS_INTL(Package, App, Configs...) { .CMD=${tool:"maps/infra/yacare/scripts/make_configs"} $Package $App ${cwd:BINDIR} ${output;hide;pre=debian/$Package/:Configs} -} - +} + # tag:ycr-specific macro _YCR_GENERATE_CONFIGS(Package, App) { .CMD=$_YCR_GENERATE_CONFIGS_INTL($Package $App ${pre=etc/yandex/maps/yacare/:App.conf} ${pre=etc/template_generator/templates/etc/logrotate.d/:App} ${pre=etc/nginx/sites-available/:App.conf} ${pre=etc/syslog-ng/conf-available/:App.conf} ${pre=etc/template_generator/config.d/:App.yaml} ${pre=/juggler/checks-available/yacare_;suf=/MANIFEST.json:App} ${pre=etc/yandex/maps/roquefort/:App.conf} ${pre=usr/lib/yandex/maps/yacare/lua/init_worker.d/rate_limiter_:App.lua} ${pre=usr/lib/yandex/maps/yacare/lua/init_worker.d/tvm_:App.lua} ${pre=usr/lib/yandex/maps/yacare/lua/init.d/tvm_:App.lua} ${pre=etc/template_generator/templates/etc/supervisor/conf-available/:App.conf} ${pre=etc/template_generator/templates/etc/yandex/unified_agent/conf.d/04_yacare_:App.yml}) -} - +} + # tag:ycr-specific when ($TIDY=="yes") { YCR_LINK_EXE=$LINK_EXE @@ -1764,16 +1764,16 @@ when ($TIDY=="yes") { otherwise { YCR_LINK_EXE=$LINK_EXE && $_YCR_GENERATE_CONFIGS($MODULE_PREFIX$REALPRJNAME $MODULE_PREFIX$REALPRJNAME) } - + # tag:ycr-specific ### @usage: YCR_PROGRAM([progname]) ### ### yacare-specific program module. Generates yacare configs in addition to producing the program. ### If name is not specified it will be generated from the name of the containing project directory. -module YCR_PROGRAM: PROGRAM { - .CMD=YCR_LINK_EXE -} - +module YCR_PROGRAM: PROGRAM { + .CMD=YCR_LINK_EXE +} + # tag:ycr-specific tag:python-specific macro _PYCR_GENERATE_CONFIGS_INTL(Package, App, Configs...) { .CMD=${tool:"maps/infra/pycare/scripts/make_configs"} $Package $App ${cwd:BINDIR} ${output;hide;pre=configs/:Configs} @@ -1803,8 +1803,8 @@ module PYCR_PROGRAM: PY3_PROGRAM_BIN { ### The other option use EXPORTS parameter of the DLL module itself. ### ### @see: [DLL](#module_DLL) -macro EXPORTS_SCRIPT(Arg) { - SET(EXPORTS_FILE $Arg) +macro EXPORTS_SCRIPT(Arg) { + SET(EXPORTS_FILE $Arg) } ### @usage: NO_EXPORT_DYNAMIC_SYMBOLS() @@ -1844,7 +1844,7 @@ module _BASE_UNITTEST: _BASE_PROGRAM { SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS canondata/result.json) } -UNITTEST_SEM=$CPP_PROGRAM_SEM && add_test NAME $REALPRJNAME COMMAND $REALPRJNAME +UNITTEST_SEM=$CPP_PROGRAM_SEM && add_test NAME $REALPRJNAME COMMAND $REALPRJNAME # tag:test ### @usage: UNITTEST([name]) ### @@ -1853,7 +1853,7 @@ UNITTEST_SEM=$CPP_PROGRAM_SEM && add_test NAME $REALPRJNAME COMMAND $REALPRJNAME ### ### Documentation: https://wiki.yandex-team.ru/yatool/test/#opisanievya.make1 module UNITTEST: _BASE_UNITTEST { - .SEM=UNITTEST_SEM + .SEM=UNITTEST_SEM PEERDIR(library/cpp/testing/unittest_main) ADD_YTEST($MODULE_PREFIX$REALPRJNAME unittest.py) SET(MODULE_LANG CPP) @@ -1884,7 +1884,7 @@ module UNITTEST_WITH_CUSTOM_ENTRY_POINT: _BASE_UNITTEST { ### ### Documentation: https://docs.yandex-team.ru/arcadia-cpp/cpp_test module GTEST: _BASE_UNITTEST { - .SEM=UNITTEST_SEM + .SEM=UNITTEST_SEM PEERDIR(library/cpp/testing/gtest library/cpp/testing/gtest_main) ADD_YTEST($MODULE_PREFIX$REALPRJNAME gunittest) SET(MODULE_LANG CPP) @@ -1906,19 +1906,19 @@ module FUZZ: _BASE_PROGRAM { .NODE_TYPE=Program .FINAL_TARGET=no .ALLOWED=FUZZ_DICTS FUZZ_OPTS - + DEFAULT(LIBFUZZER_PATH contrib/libs/libfuzzer12) - when ($USE_AFL == "no") { + when ($USE_AFL == "no") { PEERDIR+=$LIBFUZZER_PATH - } - when ($USE_AFL == "yes") { + } + when ($USE_AFL == "yes") { PEERDIR+=$LIBFUZZER_PATH/afl - } - - when (!$SANITIZER_TYPE || $SANITIZER_TYPE == "no") { - PEERDIR+=devtools/nofuzz - } - + } + + when (!$SANITIZER_TYPE || $SANITIZER_TYPE == "no") { + PEERDIR+=devtools/nofuzz + } + ADD_YTEST($MODULE_PREFIX$REALPRJNAME fuzz.test) } @@ -1978,8 +1978,8 @@ FUZZ_DICTS_VALUE= ### Should only be used in FUZZ modules. ### ### Documentation: https://wiki.yandex-team.ru/yatool/fuzzing/ -macro FUZZ_DICTS(Data...) { - SET_APPEND(FUZZ_DICTS_VALUE $Data) +macro FUZZ_DICTS(Data...) { + SET_APPEND(FUZZ_DICTS_VALUE $Data) } FUZZ_OPTS_VALUE= @@ -1997,8 +1997,8 @@ FUZZ_OPTS_VALUE= ### ) ### ### Documentation: https://wiki.yandex-team.ru/yatool/fuzzing/ -macro FUZZ_OPTS(Data...) { - SET_APPEND(FUZZ_OPTS_VALUE $Data) +macro FUZZ_OPTS(Data...) { + SET_APPEND(FUZZ_OPTS_VALUE $Data) } # tag:yt-specific tag:test @@ -2022,7 +2022,7 @@ TEST_SRCS_VALUE= ### In PY2TEST, PY3TEST and PY*_LIBRARY modules used as PY_SRCS macro and additionally used to mine test cases to be executed by testing framework. ### ### Documentation: https://wiki.yandex-team.ru/yatool/test/#testynapytest -macro TEST_SRCS(Tests...) { +macro TEST_SRCS(Tests...) { SET_APPEND(TEST_SRCS_VALUE $Tests) } @@ -2041,8 +2041,8 @@ TEST_DATA_VALUE= ### Used only inside TEST modules. ### ### Documentation: https://wiki.yandex-team.ru/yatool/test/#dannyeizrepozitorija -macro DATA(Data...) { - SET_APPEND(TEST_DATA_VALUE $Data) +macro DATA(Data...) { + SET_APPEND(TEST_DATA_VALUE $Data) ADD_CHECK(check.data $Data) } @@ -2054,8 +2054,8 @@ TEST_TAGS_VALUE= ### There are also special tags affecting test behaviour, for example ya:external, sb:ssd. ### ### Documentation: https://wiki.yandex-team.ru/yatool/test/#obshhieponjatija -macro TAG(Tags...) { - SET_APPEND(TEST_TAGS_VALUE $Tags) +macro TAG(Tags...) { + SET_APPEND(TEST_TAGS_VALUE $Tags) } # tag:test @@ -2065,7 +2065,7 @@ TEST_REQUIREMENTS_VALUE= ### Allows you to specify the requirements of the test. ### ### Documentation about the Arcadia test system: https://wiki.yandex-team.ru/yatool/test/ -macro REQUIREMENTS(Tags...) { +macro REQUIREMENTS(Tags...) { SET_APPEND(TEST_REQUIREMENTS_VALUE $Tags) } @@ -2074,7 +2074,7 @@ TEST_ENV_VALUE= ### @usage: ENV(key[=value]) ### ### Sets env variable key to value (gets value from system env by default). -macro ENV(Data...) { +macro ENV(Data...) { SET_APPEND(TEST_ENV_VALUE ${quo:Data}) } @@ -2092,7 +2092,7 @@ TEST_RECIPES_VALUE= ### Provides prepared environment via recipe for test. ### ### Documentation: https://wiki.yandex-team.ru/yatool/test/recipes -macro USE_RECIPE(Data...) { +macro USE_RECIPE(Data...) { SET_APPEND(TEST_RECIPES_VALUE $Data) SET_APPEND(TEST_RECIPES_VALUE "USE_RECIPE_DELIM") } @@ -2104,8 +2104,8 @@ TEST_PYTHON_PATH_VALUE= ### @usage: PYTHON_PATH(Path) ### ### Set path to Python that will be used to runs scripts in tests -macro PYTHON_PATH(Path) { - SET(TEST_PYTHON_PATH_VALUE $Path) +macro PYTHON_PATH(Path) { + SET(TEST_PYTHON_PATH_VALUE $Path) } # tag:test @@ -2113,7 +2113,7 @@ SKIP_TEST_VALUE= ### @usage: SKIP_TEST(Reason) ### ### Skip the suite defined by test module. Provide a reason to be output in test execution report. -macro SKIP_TEST(Reason...) { +macro SKIP_TEST(Reason...) { SET(SKIP_TEST_VALUE $Reason) } @@ -2122,15 +2122,15 @@ LINT_LEVEL_VALUE=extended ### @usage: NO_LINT() ### ### Do not check for style files included in PY_SRCS, TEST_SRCS, JAVA_SRCS. -macro NO_LINT() { - SET(LINT_LEVEL_VALUE none) +macro NO_LINT() { + SET(LINT_LEVEL_VALUE none) } ### @usage: LINT(<none|base|strict>) ### ### Set linting levem for sources of the module -macro LINT(level) { - SET(LINT_LEVEL_VALUE $level) +macro LINT(level) { + SET(LINT_LEVEL_VALUE $level) } # tag:python-specific tag:test @@ -2149,13 +2149,13 @@ module _BASE_PYTEST: _BASE_PY_PROGRAM { .NODE_TYPE=Program .FINAL_TARGET=no .ALLOWED=YT_SPEC NO_DOCTESTS - when ($USE_ARCADIA_PYTHON == "yes") { - PEERDIR+=library/python/pytest - } - when ($USE_ARCADIA_PYTHON == "no") { - MODULE_SUFFIX=.pkg.fake - PEERDIR+=library/python/pytest/empty - } + when ($USE_ARCADIA_PYTHON == "yes") { + PEERDIR+=library/python/pytest + } + when ($USE_ARCADIA_PYTHON == "no") { + MODULE_SUFFIX=.pkg.fake + PEERDIR+=library/python/pytest/empty + } SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS canondata/result.json) } @@ -2166,7 +2166,7 @@ module _BASE_PYTEST: _BASE_PY_PROGRAM { ### Same as PY2TEST. Don't use this, use PY2TEST instead. module PYTEST_BIN: _BASE_PYTEST { .NODE_TYPE=Program - SETUP_PYTEST_BIN() + SETUP_PYTEST_BIN() } # tag:python-specific tag:test @@ -2328,9 +2328,9 @@ ADDITIONAL_PATH= # set for tests variables to fill it by YA_DEV or YA YA_ROOT=ya -when ($YA_DEV == "yes") { - YA_ROOT=ya-dev -} +when ($YA_DEV == "yes") { + YA_ROOT=ya-dev +} # tag:test @@ -2341,10 +2341,10 @@ when ($YA_DEV == "yes") { ### path/to/lib is the path to the directory with the LIBRARY project. ### ### Documentation about the Arcadia test system: https://wiki.yandex-team.ru/yatool/test/ -module UNITTEST_FOR: UNITTEST { +module UNITTEST_FOR: UNITTEST { .SEM=UNITTEST_SEM - PEERDIR(ADDINCL $UNITTEST_DIR) - SRCDIR($UNITTEST_DIR) + PEERDIR(ADDINCL $UNITTEST_DIR) + SRCDIR($UNITTEST_DIR) } ### @usage: _LIBRARY # internal @@ -2353,9 +2353,9 @@ module UNITTEST_FOR: UNITTEST { ### Contains basic logic like module properties, default variable values etc. ### All libraries similar to C++-libraries should be inherited from it. module _LIBRARY: _BASE_UNIT { - .CMD=LINK_LIB - .NODE_TYPE=Library - .PEERDIR_POLICY=as_include + .CMD=LINK_LIB + .NODE_TYPE=Library + .PEERDIR_POLICY=as_include .EXTS=.o .obj .a .mf .supp .tidyjson .ld .ALLOWED=GRPC USE_SKIFF EXTRALIBS OBJADDE_GLOBAL RESOURCE_FILES .GLOBAL=USER_CFLAGS USER_CXXFLAGS USER_CONLYFLAGS LDFLAGS SRCS _WHOLE_ARCHIVE_LIBS_VALUE RPATH @@ -2367,19 +2367,19 @@ module _LIBRARY: _BASE_UNIT { GLOBAL_SUFFIX=.global$MODULE_SUFFIX #TODO: Remove this hack (really we do not need add fake src at all) - ENABLE(NEED_ADD_FAKE_SRC) + ENABLE(NEED_ADD_FAKE_SRC) _REQUIRE_EXPLICIT_LICENSE(contrib/deprecated contrib/libs contrib/restricted contrib/python) CHECK_CONTRIB_CREDITS(contrib/clickhouse contrib/libs contrib/deprecated EXCEPT contrib/deprecated/python) - - when ($USE_MKL == "yes") { - NOPLATFORM=yes - } - - when ($MSVC == "yes" || $CYGWIN == "yes") { - MODULE_PREFIX= - MODULE_SUFFIX=.lib - } - otherwise { + + when ($USE_MKL == "yes") { + NOPLATFORM=yes + } + + when ($MSVC == "yes" || $CYGWIN == "yes") { + MODULE_PREFIX= + MODULE_SUFFIX=.lib + } + otherwise { when ($TIDY == "yes") { MODULE_PREFIX= MODULE_SUFFIX=.tidyjson @@ -2388,21 +2388,21 @@ module _LIBRARY: _BASE_UNIT { MODULE_PREFIX=lib MODULE_SUFFIX=.a } - } - + } + when ($WERROR != "no") { - when ($WERROR_MODE == "all" || ($WERROR_MODE == "compiler_specific" && $WERROR == "yes")) { + when ($WERROR_MODE == "all" || ($WERROR_MODE == "compiler_specific" && $WERROR == "yes")) { C_WARNING_OPTS += $WERROR_FLAG - } - } + } + } - when ($WITH_VALGRIND == "yes") { - PEERDIR+=contrib/libs/valgrind - } - - when ($USE_ARCADIA_LIBM == "yes") { - PEERDIR+=contrib/libs/libm - } + when ($WITH_VALGRIND == "yes") { + PEERDIR+=contrib/libs/valgrind + } + + when ($USE_ARCADIA_LIBM == "yes") { + PEERDIR+=contrib/libs/libm + } } CPP_LIBRARY_SEM=add_library ${MODDIR} $REALPRJNAME ${hide:TARGET} ${hide:AUTO_INPUT} \ @@ -2433,8 +2433,8 @@ CONAN_REQUIRE= ### It makes little sense to mention LIBRARY in DEPENDS or BUNDLE, package and deploy it since it is not a standalone entity. ### In order to use library in tests PEERDIR it to link into tests. ### If you think you need to distribute static library please contact devtools@ for assistance. -module LIBRARY: _LIBRARY { - .GLOBAL=_AARS _PROGUARD_RULES +module LIBRARY: _LIBRARY { + .GLOBAL=_AARS _PROGUARD_RULES .ALIASES=REQUIREMENTS=CC_REQUIREMENTS .SEM=CPP_LIBRARY_SEM .GLOBAL_SEM=CPP_OBJ_LIBRARY_SEM @@ -2456,7 +2456,7 @@ module LIBRARY: _LIBRARY { when ($HAS_CPP_PROTOBUF_PEERS == "yes") { PEERDIR+=$CPP_PROTOBUF_PEERS - } + } SET(MODULE_TYPE LIBRARY) SET(MODULE_LANG CPP) @@ -2464,29 +2464,29 @@ module LIBRARY: _LIBRARY { } # tag:internal -### @usage: _BARE_MODULE() # internal -### -### Remove unwanted dependencies for "empty" library module -macro _BARE_MODULE() { - SET(NEED_PLATFORM_PEERDIRS no) - SET(PEERDIR_TEST_TOOL no) - DISABLE(WITH_VALGRIND) - NO_CODENAVIGATION() - NO_PLATFORM() - NO_RUNTIME() - NO_UTIL() +### @usage: _BARE_MODULE() # internal +### +### Remove unwanted dependencies for "empty" library module +macro _BARE_MODULE() { + SET(NEED_PLATFORM_PEERDIRS no) + SET(PEERDIR_TEST_TOOL no) + DISABLE(WITH_VALGRIND) + NO_CODENAVIGATION() + NO_PLATFORM() + NO_RUNTIME() + NO_UTIL() NO_CLANG_TIDY() -} - +} + # tag:internal -### @usage: _BARE_LINK_MODULE() # internal -### -### Remove unwanted dependencies for "empty" link module -macro _BARE_LINK_MODULE() { - _BARE_MODULE() - ALLOCATOR(FAKE) -} - +### @usage: _BARE_LINK_MODULE() # internal +### +### Remove unwanted dependencies for "empty" link module +macro _BARE_LINK_MODULE() { + _BARE_MODULE() + ALLOCATOR(FAKE) +} + # tag:internal ### @usage: _CONDITIONAL_SRCS([USE_CONDITIONAL_SRCS] Files...) # internal ### @@ -2546,10 +2546,10 @@ otherwise { ### static libraries, local (from own SRCS) and global (from peers') object files. ### ### Designed for use in XCode projects for iOS. -module FAT_OBJECT: LIBRARY { +module FAT_OBJECT: LIBRARY { .ALLOWED=PACK_GLOBALS_IN_LIBRARY .CMD=LINK_FAT_OBJECT_CMD - .PEERDIR_POLICY=as_build_from + .PEERDIR_POLICY=as_build_from when ($MSVC == "yes" || $CYGWIN == "yes") { MODULE_SUFFIX=.global.lib @@ -2593,34 +2593,34 @@ _SONAME= ### Contains all general logic for such kind of modules. Supports versioning and export files. ### Cannot participate in linking to programs, intended to be used as final artifact (packaged and deployed). module DLL_UNIT: _LINK_UNIT { - .CMD=LINK_DYN_LIB - .NODE_TYPE=Library - .SYMLINK_POLICY=SO + .CMD=LINK_DYN_LIB + .NODE_TYPE=Library + .SYMLINK_POLICY=SO .GLOBAL=USER_CFLAGS USER_CXXFLAGS USER_CONLYFLAGS LDFLAGS _WHOLE_ARCHIVE_LIBS_VALUE RPATH - .ALLOWED=WHOLE_ARCHIVE + .ALLOWED=WHOLE_ARCHIVE DYNAMIC_LINK=yes - ALLOCATOR(FAKE) + ALLOCATOR(FAKE) SET(MODULE_TYPE DLL) SET(MODULE_TAG DLL) SET(MODULE_LANG CPP) ADD_CLANG_TIDY() - when ($MSVC == "yes" || $CYGWIN == "yes") { - MODULE_SUFFIX=.dll - } + when ($MSVC == "yes" || $CYGWIN == "yes") { + MODULE_SUFFIX=.dll + } elsewhen ($DARWIN == "yes" || $OS_IOS == "yes") { - MODULE_PREFIX=lib + MODULE_PREFIX=lib MODULE_SUFFIX=.dylib - } + } elsewhen ($TIDY == "yes") { MODULE_PREFIX= MODULE_SUFFIX=.tidyjson } - otherwise { - MODULE_PREFIX=lib + otherwise { + MODULE_PREFIX=lib MODULE_SUFFIX=.so - } - + } + # This by now replicates ymake's bahavior. We'll get rid of SONAME setting in ymake and fix this code alltogether SONAME=${pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX:REALPRJNAME} when ($MODULE_VERSION) { @@ -2628,13 +2628,13 @@ module DLL_UNIT: _LINK_UNIT { } _SONAME=$SONAME$MODULE_VERSION - when ($LINUX == "yes") { + when ($LINUX == "yes") { # '-z notext' is needed for linking mkl into shared libraries - LDFLAGS += -Wl,-z,notext + LDFLAGS += -Wl,-z,notext when ($_NO_FIX_ELF != "yes") { LINK_DYN_LIB_FLAGS+=--fix-elf ${tool:"tools/fix_elf"} } - } + } when ($DARWIN == "yes") { LDFLAGS += -undefined dynamic_lookup @@ -2663,10 +2663,10 @@ module DLL_UNIT: _LINK_UNIT { ### ### Documentation: https://wiki.yandex-team.ru/devtools/commandsandvars/py_srcs/ module PY_ANY_MODULE: DLL_UNIT { - when ($MSVC != "yes" && $DARWIN != "yes") { - LDFLAGS+= -Wl,-Bsymbolic - } - + when ($MSVC != "yes" && $DARWIN != "yes") { + LDFLAGS+= -Wl,-Bsymbolic + } + when ($USE_ARCADIA_PYTHON == "no") { when ($USE_SYSTEM_PYTHON) { PEERDIR+=build/platform/python @@ -2676,8 +2676,8 @@ module PY_ANY_MODULE: DLL_UNIT { LDFLAGS+=$PYTHON_LIBRARIES } } - } - + } + # This by now replicates ymake's bahavior. We'll get rid of SONAME setting in ymake and fix this code alltogether SONAME=${pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX:REALPRJNAME} when ($MODULE_VERSION) { @@ -2686,18 +2686,18 @@ module PY_ANY_MODULE: DLL_UNIT { _SONAME=$SONAME$MODULE_VERSION # -bundle - when ($DARWIN == "yes") { + when ($DARWIN == "yes") { LDFLAGS+=-flat_namespace - } - - when ($MSVC == "yes" || $CYGWIN == "yes") { + } + + when ($MSVC == "yes" || $CYGWIN == "yes") { MODULE_PREFIX= MODULE_SUFFIX=.pyd - } - otherwise { - MODULE_PREFIX= + } + otherwise { + MODULE_PREFIX= MODULE_SUFFIX=.so - } + } .RESTRICTED=USE_PYTHON2 USE_PYTHON3 PY_SRCS PY_MAIN } @@ -2771,17 +2771,17 @@ macro PYTHON3_MODULE() { ### 2. The resulting .so will have the prefix "lib". ### 3. Processing EXPORTS and PREFIX is the same as for DLL module ### This is native DLL, so it will select C++ version from PROTO_LIBRARY. -module R_MODULE: DLL_UNIT { - when ($DARWIN == "yes") { +module R_MODULE: DLL_UNIT { + when ($DARWIN == "yes") { LDFLAGS+=-flat_namespace -dynamiclib - } + } - when ($MSVC == "yes" || $CYGWIN == "yes") { - MODULE_PREFIX=lib - MODULE_SUFFIX=.dll - } - - ADDINCL(contrib/libs/r-lang) + when ($MSVC == "yes" || $CYGWIN == "yes") { + MODULE_PREFIX=lib + MODULE_SUFFIX=.dll + } + + ADDINCL(contrib/libs/r-lang) } ### @usage: DYNAMIC_LIBRARY_FROM(Paths) @@ -2801,20 +2801,20 @@ macro DYNAMIC_LIBRARY_FROM(Path...) { ### 3. PREFIX allows you to change the prefix of the output file (default DLL has the prefix "lib"). ### ### DLL cannot participate in linking to programs but can be used from Java or as final artifact (packaged and deployed). -module DLL: DLL_UNIT { - SET(MAKE_ONLY_SHARED_LIB yes) +module DLL: DLL_UNIT { + SET(MAKE_ONLY_SHARED_LIB yes) SET(MODULE_LANG CPP) when ($OS_WINDOWS) { - MODULE_SUFFIX=.dll - } + MODULE_SUFFIX=.dll + } # TODO: Make it possible to use this syntax - # DEFAULT(DLL_FOR_DIR no) - ### FIXME: XXX - ###when ($DLL_FOR_DIR != "no") { - ### SRCDIR($DLL_FOR_DIR) - ### ADDINCL($DLL_FOR_DIR) - ###} + # DEFAULT(DLL_FOR_DIR no) + ### FIXME: XXX + ###when ($DLL_FOR_DIR != "no") { + ### SRCDIR($DLL_FOR_DIR) + ### ADDINCL($DLL_FOR_DIR) + ###} } ### DLL_TOOL is a DLL that can be used as a LD_PRELOAD tool. @@ -2822,7 +2822,7 @@ module DLL_TOOL: DLL { # ymake resolves only program nodes as tools. .NODE_TYPE=Program } - + ### @usage: SO_PROGRAM(name major_ver [minor_ver] [EXPORTS symlist_file] [PREFIX prefix]) ### ### Executable dynamic library module defintion. @@ -2845,45 +2845,45 @@ module SO_PROGRAM: DLL { DLL_PROXY_CMD_MF=$GENERATE_MF && $COPY_CMD $AUTO_INPUT $TARGET # tag:internal -### @usage: DEV_DLL_PROXY() # internal -### -### The use of this module is strictly prohibited!!! -### This is a temporary and project-specific solution. +### @usage: DEV_DLL_PROXY() # internal +### +### The use of this module is strictly prohibited!!! +### This is a temporary and project-specific solution. module DEV_DLL_PROXY: _BARE_UNIT { - .NODE_TYPE=Library + .NODE_TYPE=Library .EXTS=.so .dll .dylib .mf - .CMD=DLL_PROXY_CMD_MF + .CMD=DLL_PROXY_CMD_MF DYNAMIC_LINK=yes - + when ($OS_WINDOWS == "yes") { - MODULE_SUFFIX=.dll - } - elsewhen ($DARWIN == "yes" || $OS_IOS == "yes") { - MODULE_PREFIX=lib - MODULE_SUFFIX=.dylib$MODULE_VERSION - } - otherwise { - MODULE_PREFIX=lib - MODULE_SUFFIX=.so$MODULE_VERSION - } -} - + MODULE_SUFFIX=.dll + } + elsewhen ($DARWIN == "yes" || $OS_IOS == "yes") { + MODULE_PREFIX=lib + MODULE_SUFFIX=.dylib$MODULE_VERSION + } + otherwise { + MODULE_PREFIX=lib + MODULE_SUFFIX=.so$MODULE_VERSION + } +} + # tag:internal -### @usage: DLL_PROXY() # internal -### -### The use of this module is strictly prohibited!!! -### This is a temporary and project-specific solution. -module DLL_PROXY: DEV_DLL_PROXY { +### @usage: DLL_PROXY() # internal +### +### The use of this module is strictly prohibited!!! +### This is a temporary and project-specific solution. +module DLL_PROXY: DEV_DLL_PROXY { .EXTS=.so .dylib .lib .mf - .PROXY=yes - .PEERDIR_POLICY=as_build_from + .PROXY=yes + .PEERDIR_POLICY=as_build_from SET(PEERDIR_TAGS DLL __EMPTY__) - + when ($OS_WINDOWS == "yes") { - MODULE_SUFFIX=.lib - } -} - + MODULE_SUFFIX=.lib + } +} + # tag:internal ### @usage: DYNAMIC_DEPS(Path...) # internal, temporary ### @@ -2930,15 +2930,15 @@ multimodule DYNAMIC_LIBRARY { } } -### @usage: GLOBAL_SRCS(filenames...) -### +### @usage: GLOBAL_SRCS(filenames...) +### ### Make all source files listed as GLOBAL. -### Call to GLOBAL_SRCS macro is equivalent to call to SRCS macro when each source file is marked with GLOBAL keyword. -### Arcadia root relative or project dir relative paths are supported for filenames arguments. GLOBAL keyword is not -### recognized for GLOBAL_SRCS in contrast to SRCS macro. -### -### @example: -### Consider the file to ya.make: +### Call to GLOBAL_SRCS macro is equivalent to call to SRCS macro when each source file is marked with GLOBAL keyword. +### Arcadia root relative or project dir relative paths are supported for filenames arguments. GLOBAL keyword is not +### recognized for GLOBAL_SRCS in contrast to SRCS macro. +### +### @example: +### Consider the file to ya.make: ### ### LIBRARY() ### GLOBAL_SRCS(foo.cpp bar.cpp) @@ -2949,13 +2949,13 @@ macro GLOBAL_SRCS(Files...) { SRCS(${pre=GLOBAL :Files}) } -### @usage: ALL_SRCS([GLOBAL] filenames...) -### +### @usage: ALL_SRCS([GLOBAL] filenames...) +### ### Make all source files listed as GLOBAL or not depending on the keyword GLOBAL -### Call to ALL_SRCS macro is equivalent to call to GLOBAL_SRCS macro when GLOBAL keyword is specified -### as the first argument and is equivalent to call to SRCS macro otherwise. -### -### @example: +### Call to ALL_SRCS macro is equivalent to call to GLOBAL_SRCS macro when GLOBAL keyword is specified +### as the first argument and is equivalent to call to SRCS macro otherwise. +### +### @example: ### ### LIBRARY() ### SET(MAKE_IT_GLOBAL GLOBAL) @@ -2963,10 +2963,10 @@ macro GLOBAL_SRCS(Files...) { ### END() ### ### @see: [GLOBAL_SRCS()](#macro_GLOBAL_SRCS), [SRCS()](#macro_SRCS) -macro ALL_SRCS(GLOBAL?"GLOBAL":"", Files...) { - SRCS(${pre=$GLOBAL :Files}) -} - +macro ALL_SRCS(GLOBAL?"GLOBAL":"", Files...) { + SRCS(${pre=$GLOBAL :Files}) +} + ### @usage: _DLL_COMPATIBLE_LIBRARY # internal ### ### Base module to place DLLs into multimodules back to back with libraries. @@ -2989,15 +2989,15 @@ PACKED_PACKAGE_EXT= ### Is not allowed other module types than PACKAGE(). ### ### @see: [PACKAGE()](#module_PACKAGE) -macro PACK(Ext) { - SET(PACKED_PACKAGE_EXT $Ext) -} - -PACKAGE_STRICT_VALUE= -macro PACKAGE_STRICT() { - SET(PACKAGE_STRICT_VALUE yes) +macro PACK(Ext) { + SET(PACKED_PACKAGE_EXT $Ext) } +PACKAGE_STRICT_VALUE= +macro PACKAGE_STRICT() { + SET(PACKAGE_STRICT_VALUE yes) +} + ### @usage: PACKAGE(name) ### ### Module collects what is described directly inside it, builds and collects all its transitively available PEERDIRs. @@ -3011,16 +3011,16 @@ macro PACKAGE_STRICT() { ### @see: [PACK()](#macro_PACK) module PACKAGE: _BASE_UNIT { .CMD=TOUCH_PACKAGE_MF - .PEERDIR_POLICY=as_build_from - .ALL_INS_TO_OUT=yes + .PEERDIR_POLICY=as_build_from + .ALL_INS_TO_OUT=yes .FINAL_TARGET=yes .ALLOWED=PACK - SET(MODULE_SUFFIX .pkg.fake) + SET(MODULE_SUFFIX .pkg.fake) SET(DONT_RESOLVE_INCLUDES yes) - NO_PLATFORM() - when ($PACKED_PACKAGE_EXT) { + NO_PLATFORM() + when ($PACKED_PACKAGE_EXT) { PACKED_PACKAGE_ARGS+=--dest-arch ${output;pre=$MODULE_PREFIX;suf=.$PACKED_PACKAGE_EXT:REALPRJNAME} - } + } SET(NEED_PLATFORM_PEERDIRS no) PEERDIR_TAGS=CPP_PROTO CPP_FBS PY2 PY2_NATIVE YQL_UDF_SHARED __EMPTY__ DOCBOOK JAR_RUNNABLE PY3_BIN PY3TEST_PROGRAM DLL } @@ -3071,10 +3071,10 @@ macro RESOLVE_PROTO() { ### ### Documentation: https://wiki.yandex-team.ru/yatool/large-data/ module UNION: _BASE_UNIT { - .ALL_INS_TO_OUT=yes + .ALL_INS_TO_OUT=yes .FINAL_TARGET=no - NO_PLATFORM() - SET(MODULE_SUFFIX .pkg.fake) + NO_PLATFORM() + SET(MODULE_SUFFIX .pkg.fake) SET(DONT_RESOLVE_INCLUDES yes) .CMD=TOUCH_UNIT_MF SET(NEED_PLATFORM_PEERDIRS no) @@ -3082,160 +3082,160 @@ module UNION: _BASE_UNIT { } # tag:python-specific -module _PY_PACKAGE: UNION { - .EXTS=.py - .ALL_INS_TO_OUT=yes +module _PY_PACKAGE: UNION { + .EXTS=.py + .ALL_INS_TO_OUT=yes .ALLOWED=GRPC USE_SKIFF - ENABLE(PY_PROTOS_FOR) - SET(PEERDIR_TAGS PY_PROTO) + ENABLE(PY_PROTOS_FOR) + SET(PEERDIR_TAGS PY_PROTO) SET(DONT_RESOLVE_INCLUDES no) -} +} # tag:python-specific tag:deprecated tag:internal ### @usage: PY_PACKAGE(name) # internal, deprecated ### ### This is module created via PY_PROTOS_FOR() macro -module PY_PACKAGE: _PY_PACKAGE { +module PY_PACKAGE: _PY_PACKAGE { .FINAL_TARGET=yes } -# tag:internal -### @usage: _SET_FIRST_VALUE(name args...) # interanl -### -### This macro sets the value of `name` vraiable to the value of next argument -macro _SET_FIRST_VALUE(NAME, VALUE, OTHER...) { - SET($NAME $VALUE) -} - -# tag:internal -macro _EVAL_HIDE_TOOLS(ARGS...) { - .CMD=${tool;hide:ARGS} -} - -# tag:internal -macro _EVAL_HIDE_INPUTS(ARGS...) { - .CMD=${input;hide:ARGS} -} - +# tag:internal +### @usage: _SET_FIRST_VALUE(name args...) # interanl +### +### This macro sets the value of `name` vraiable to the value of next argument +macro _SET_FIRST_VALUE(NAME, VALUE, OTHER...) { + SET($NAME $VALUE) +} + +# tag:internal +macro _EVAL_HIDE_TOOLS(ARGS...) { + .CMD=${tool;hide:ARGS} +} + +# tag:internal +macro _EVAL_HIDE_INPUTS(ARGS...) { + .CMD=${input;hide:ARGS} +} + # tag:docs -_DOCS_USE_PLANTUML=no -_DOCS_EXTRA_TOOLS= -_DOCS_EXTRA_INPUTS= -_DOCS_ENV= -_DOCS_KV=${kv;hide:"p DO"} ${kv;hide:"pc light-cyan"} ${kv;hide:"show_out yes"} - -_DOCS_PLANTUML_ENV=\ -${env:"JAVA_PATH=$JDK_RESOURCE_GLOBAL/bin/java"} \ -${env:"PLANTUML_PATH=${ARCADIA_BUILD_ROOT}/contrib/tools/plantuml/plantuml.run.cp.jar"} \ -${env:"_JAVA_OPTIONS=-Dsun.awt.fontconfig=$BINDIR/fontconfig.properties"} \ -${env:"LANG=en_US.UTF-8"} \ -${env:"LC_ALL=C.UTF-8"} - -_DOCS_BOOK_CMD=$TOUCH_DOCS_MF -_DOCS_LIB_CMD=$TOUCH_DOCS_MF - -_DOCS_VARS_FLAG= - -_DOCS_COMMON_PROCESS_DEPS= -_DOCS_COMMON_LIB_PROCESS_DEPS= - -_DOCS_YFM_OUTPUT_FORMAT= -_DOCS_YFM_BOOK_OUTPUT_FORMAT=--output-format html --allowHTML -_DOCS_YFM_LIB_OUTPUT_FORMAT=--output-format md -_DOCS_YFM_BOOK_PROCESS_DEPS=${cwd:ARCADIA_BUILD_ROOT} $YMAKE_PYTHON ${input:"build/scripts/extract_docs.py"} --skip-prefix $ARCADIA_BUILD_ROOT --dest-dir $BINDIR/__s ${rootrel:PEERS} - -_DOCS_COMMON_CMDLINE_PREFIX=\ -${cwd:ARCADIA_ROOT} $FS_TOOLS copy_all_files $_DOCS_DIR_VALUE $BINDIR/__s $_DOCS_SRCS_VALUE \ -&& $_DOCS_COMMON_PROCESS_DEPS \ -&& $YMAKE_PYTHON ${input:"build/scripts/copy_files_to_dir.py"} --dest-dir $BINDIR/__s --skip-prefix $ARCADIA_ROOT --skip-prefix $ARCADIA_BUILD_ROOT ${input;context=TEXT:INCLUDE_SRCS} - -_DOCS_YFM_BOOK_CMDLINIE=\ -$_DOCS_COMMON_CMDLINE_PREFIX \ -&& $YMAKE_PYTHON ${input:"build/scripts/stdout2stderr.py"} $YFM_TOOL_RESOURCE_GLOBAL/yfm-docs --input $BINDIR/__s --output $BINDIR/__docsbuild $_DOCS_VARS_FLAG $_DOCS_YFM_OUTPUT_FORMAT --config ${input:CONFIG} $_DOCS_EXTRA_TOOLS ${hide;input:EXTRA_INPUTS} $_DOCS_ENV \ -&& $YMAKE_PYTHON ${input:"build/scripts/tar_sources.py"} --output $TARGET --input $BINDIR/__docsbuild $_DOCS_KV - -# tag:internal tag:docs -macro _DOCS_YFM_BOOK_IMPL(CONFIG, INCLUDE_SRCS[], EXTRA_INPUTS[]) { - .CMD=$_DOCS_YFM_BOOK_CMDLINIE -} - -_DOCS_YFM_CMD=$_DOCS_YFM_BOOK_IMPL($_DOCS_CONFIG_VALUE INCLUDE_SRCS $_DOCS_INCLUDE_SOURCES_VALUE EXTRA_INPUTS $_DOCS_EXTRA_INPUTS) - -_DOCS_MKDOCS_CMDLINE_SUFFIX= -_DOCS_MKDOCS_BOOK_CMDLINE_SUFFIX=${pre=--dep ;ext=preprocessed.tar.gz:PEERS} -_DOCS_MKDOCS_LIB_CMDLINE_SUFFIX=--preprocess-md-only -_DOCS_MKDOCS_BOOK_PROCESS_DEPS= - -_DOCS_MKDOCS_CMDLINIE=\ -$_DOCS_COMMON_CMDLINE_PREFIX \ -&& ${cwd:BINDIR} $YMAKE_PYTHON ${input:"build/scripts/mkdocs_builder_wrapper.py"} $ARCADIA_BUILD_ROOT ${tool:"tools/mkdocs_builder"} --docs-dir $BINDIR/__s --output-tar $TARGET --config ${input:CONFIG} $_DOCS_VARS_FLAG $_DOCS_MKDOCS_CMDLINE_SUFFIX $_DOCS_EXTRA_TOOLS ${hide;input:EXTRA_INPUTS} $_DOCS_ENV $_DOCS_KV - -macro _DOCS_MKDOCS_CMD_IMPL(CONFIG, INCLUDE_SRCS[], EXTRA_INPUTS[]) { - .CMD=$_DOCS_MKDOCS_CMDLINIE -} - -_DOCS_MKDOCS_CMD=$_DOCS_MKDOCS_CMD_IMPL($_DOCS_CONFIG_VALUE INCLUDE_SRCS $_DOCS_INCLUDE_SOURCES_VALUE) - -_DOCS_YFM_DEFAULT_CONFIG=$MODDIR/.yfm -_DOCS_MKDOCS_DEFAULT_CONFIG=$MODDIR/mkdocs.yml - -### FIXME(snermolaev) -module _DOCS_BASE_UNIT: _BARE_UNIT { - .ALLOWED=DOCS_DIR DOCS_CONFIG DOCS_VARS - .CMD=TOUCH_DOCS_MF - .FINAL_TARGET=no - - ENABLE(_DOCS_BASE_UNIT) - - SET(MODULE_SUFFIX .tar.gz) +_DOCS_USE_PLANTUML=no +_DOCS_EXTRA_TOOLS= +_DOCS_EXTRA_INPUTS= +_DOCS_ENV= +_DOCS_KV=${kv;hide:"p DO"} ${kv;hide:"pc light-cyan"} ${kv;hide:"show_out yes"} + +_DOCS_PLANTUML_ENV=\ +${env:"JAVA_PATH=$JDK_RESOURCE_GLOBAL/bin/java"} \ +${env:"PLANTUML_PATH=${ARCADIA_BUILD_ROOT}/contrib/tools/plantuml/plantuml.run.cp.jar"} \ +${env:"_JAVA_OPTIONS=-Dsun.awt.fontconfig=$BINDIR/fontconfig.properties"} \ +${env:"LANG=en_US.UTF-8"} \ +${env:"LC_ALL=C.UTF-8"} + +_DOCS_BOOK_CMD=$TOUCH_DOCS_MF +_DOCS_LIB_CMD=$TOUCH_DOCS_MF + +_DOCS_VARS_FLAG= + +_DOCS_COMMON_PROCESS_DEPS= +_DOCS_COMMON_LIB_PROCESS_DEPS= + +_DOCS_YFM_OUTPUT_FORMAT= +_DOCS_YFM_BOOK_OUTPUT_FORMAT=--output-format html --allowHTML +_DOCS_YFM_LIB_OUTPUT_FORMAT=--output-format md +_DOCS_YFM_BOOK_PROCESS_DEPS=${cwd:ARCADIA_BUILD_ROOT} $YMAKE_PYTHON ${input:"build/scripts/extract_docs.py"} --skip-prefix $ARCADIA_BUILD_ROOT --dest-dir $BINDIR/__s ${rootrel:PEERS} + +_DOCS_COMMON_CMDLINE_PREFIX=\ +${cwd:ARCADIA_ROOT} $FS_TOOLS copy_all_files $_DOCS_DIR_VALUE $BINDIR/__s $_DOCS_SRCS_VALUE \ +&& $_DOCS_COMMON_PROCESS_DEPS \ +&& $YMAKE_PYTHON ${input:"build/scripts/copy_files_to_dir.py"} --dest-dir $BINDIR/__s --skip-prefix $ARCADIA_ROOT --skip-prefix $ARCADIA_BUILD_ROOT ${input;context=TEXT:INCLUDE_SRCS} + +_DOCS_YFM_BOOK_CMDLINIE=\ +$_DOCS_COMMON_CMDLINE_PREFIX \ +&& $YMAKE_PYTHON ${input:"build/scripts/stdout2stderr.py"} $YFM_TOOL_RESOURCE_GLOBAL/yfm-docs --input $BINDIR/__s --output $BINDIR/__docsbuild $_DOCS_VARS_FLAG $_DOCS_YFM_OUTPUT_FORMAT --config ${input:CONFIG} $_DOCS_EXTRA_TOOLS ${hide;input:EXTRA_INPUTS} $_DOCS_ENV \ +&& $YMAKE_PYTHON ${input:"build/scripts/tar_sources.py"} --output $TARGET --input $BINDIR/__docsbuild $_DOCS_KV + +# tag:internal tag:docs +macro _DOCS_YFM_BOOK_IMPL(CONFIG, INCLUDE_SRCS[], EXTRA_INPUTS[]) { + .CMD=$_DOCS_YFM_BOOK_CMDLINIE +} + +_DOCS_YFM_CMD=$_DOCS_YFM_BOOK_IMPL($_DOCS_CONFIG_VALUE INCLUDE_SRCS $_DOCS_INCLUDE_SOURCES_VALUE EXTRA_INPUTS $_DOCS_EXTRA_INPUTS) + +_DOCS_MKDOCS_CMDLINE_SUFFIX= +_DOCS_MKDOCS_BOOK_CMDLINE_SUFFIX=${pre=--dep ;ext=preprocessed.tar.gz:PEERS} +_DOCS_MKDOCS_LIB_CMDLINE_SUFFIX=--preprocess-md-only +_DOCS_MKDOCS_BOOK_PROCESS_DEPS= + +_DOCS_MKDOCS_CMDLINIE=\ +$_DOCS_COMMON_CMDLINE_PREFIX \ +&& ${cwd:BINDIR} $YMAKE_PYTHON ${input:"build/scripts/mkdocs_builder_wrapper.py"} $ARCADIA_BUILD_ROOT ${tool:"tools/mkdocs_builder"} --docs-dir $BINDIR/__s --output-tar $TARGET --config ${input:CONFIG} $_DOCS_VARS_FLAG $_DOCS_MKDOCS_CMDLINE_SUFFIX $_DOCS_EXTRA_TOOLS ${hide;input:EXTRA_INPUTS} $_DOCS_ENV $_DOCS_KV + +macro _DOCS_MKDOCS_CMD_IMPL(CONFIG, INCLUDE_SRCS[], EXTRA_INPUTS[]) { + .CMD=$_DOCS_MKDOCS_CMDLINIE +} + +_DOCS_MKDOCS_CMD=$_DOCS_MKDOCS_CMD_IMPL($_DOCS_CONFIG_VALUE INCLUDE_SRCS $_DOCS_INCLUDE_SOURCES_VALUE) + +_DOCS_YFM_DEFAULT_CONFIG=$MODDIR/.yfm +_DOCS_MKDOCS_DEFAULT_CONFIG=$MODDIR/mkdocs.yml + +### FIXME(snermolaev) +module _DOCS_BASE_UNIT: _BARE_UNIT { + .ALLOWED=DOCS_DIR DOCS_CONFIG DOCS_VARS + .CMD=TOUCH_DOCS_MF + .FINAL_TARGET=no + + ENABLE(_DOCS_BASE_UNIT) + + SET(MODULE_SUFFIX .tar.gz) SET(MODULE_LANG DOCS) - DEFAULT(_DOCS_BUILDER_VALUE yfm) - DEFAULT(_DOCS_DIR_VALUE ${MODDIR}) - select ($_DOCS_BUILDER) { - "yfm" ? { - PEERDIR+=build/platform/yfm - _DOCS_BOOK_CMD=$_DOCS_YFM_CMD - _DOCS_LIB_CMD=$_DOCS_YFM_CMD - _DOCS_DEFAULT_CONFIG=$_DOCS_YFM_DEFAULT_CONFIG - _DOCS_COMMON_BOOK_PROCESS_DEPS=$_DOCS_YFM_BOOK_PROCESS_DEPS - } - "mkdocs" ? { - _DOCS_BOOK_CMD=$_DOCS_MKDOCS_CMD - _DOCS_LIB_CMD=$_DOCS_MKDOCS_CMD - _DOCS_DEFAULT_CONFIG=$_DOCS_MKDOCS_DEFAULT_CONFIG - _DOCS_COMMON_BOOK_PROCESS_DEPS=$_DOCS_MKDOCS_BOOK_PROCESS_DEPS - } - } -} - -# tag:internal tag:docs -### _DOCS_EPILOOGUE() # internal -### -### This macro executes macros which should be envoked after all user -### specified macros in the ya.make file -macro _DOCS_EPILOGUE() { - SET(_DOCS_BUILDER $_DOCS_BUILDER_VALUE) - - _LATE_GLOB(_DOCS_SRCS_GLOB ${pre=${ARCADIA_ROOT}/;suf=/**/*:_DOCS_DIR_VALUE}) - SET(_DOCS_SRCS_VALUE \${input;hide:_DOCS_SRCS_GLOB}) -} - -# tag:internal tag:docs -### _DOCS_YFM_USE_PLANTUML() # internal -### -### This macr sets appropriate dependencies for use of plantuml plugin -macro _DOCS_YFM_USE_PLANTUML() { - PEERDIR(build/platform/java/jdk contrib/java/openjdk-fontconfig) - COPY_FILE(${ARCADIA_BUILD_ROOT}/contrib/java/openjdk-fontconfig/fontconfig.properties fontconfig.properties) - SET_APPEND(_DOCS_EXTRA_TOOLS \${hide;tool:"contrib/tools/plantuml"}) - SET_APPEND(_DOCS_EXTRA_INPUTS fontconfig.properties) - # It's rather strange that a commented statement below doesn't work - # SET_APPEND(_DOCS_ENV ${_DOCS_PLANTUML_ENV}) - when ($_DOCS_USE_PLANTUML) { - _DOCS_ENV+=$_DOCS_PLANTUML_ENV - } -} - + DEFAULT(_DOCS_BUILDER_VALUE yfm) + DEFAULT(_DOCS_DIR_VALUE ${MODDIR}) + select ($_DOCS_BUILDER) { + "yfm" ? { + PEERDIR+=build/platform/yfm + _DOCS_BOOK_CMD=$_DOCS_YFM_CMD + _DOCS_LIB_CMD=$_DOCS_YFM_CMD + _DOCS_DEFAULT_CONFIG=$_DOCS_YFM_DEFAULT_CONFIG + _DOCS_COMMON_BOOK_PROCESS_DEPS=$_DOCS_YFM_BOOK_PROCESS_DEPS + } + "mkdocs" ? { + _DOCS_BOOK_CMD=$_DOCS_MKDOCS_CMD + _DOCS_LIB_CMD=$_DOCS_MKDOCS_CMD + _DOCS_DEFAULT_CONFIG=$_DOCS_MKDOCS_DEFAULT_CONFIG + _DOCS_COMMON_BOOK_PROCESS_DEPS=$_DOCS_MKDOCS_BOOK_PROCESS_DEPS + } + } +} + +# tag:internal tag:docs +### _DOCS_EPILOOGUE() # internal +### +### This macro executes macros which should be envoked after all user +### specified macros in the ya.make file +macro _DOCS_EPILOGUE() { + SET(_DOCS_BUILDER $_DOCS_BUILDER_VALUE) + + _LATE_GLOB(_DOCS_SRCS_GLOB ${pre=${ARCADIA_ROOT}/;suf=/**/*:_DOCS_DIR_VALUE}) + SET(_DOCS_SRCS_VALUE \${input;hide:_DOCS_SRCS_GLOB}) +} + +# tag:internal tag:docs +### _DOCS_YFM_USE_PLANTUML() # internal +### +### This macr sets appropriate dependencies for use of plantuml plugin +macro _DOCS_YFM_USE_PLANTUML() { + PEERDIR(build/platform/java/jdk contrib/java/openjdk-fontconfig) + COPY_FILE(${ARCADIA_BUILD_ROOT}/contrib/java/openjdk-fontconfig/fontconfig.properties fontconfig.properties) + SET_APPEND(_DOCS_EXTRA_TOOLS \${hide;tool:"contrib/tools/plantuml"}) + SET_APPEND(_DOCS_EXTRA_INPUTS fontconfig.properties) + # It's rather strange that a commented statement below doesn't work + # SET_APPEND(_DOCS_ENV ${_DOCS_PLANTUML_ENV}) + when ($_DOCS_USE_PLANTUML) { + _DOCS_ENV+=$_DOCS_PLANTUML_ENV + } +} + # tag:docs ### @usage: DOCS() ### @@ -3248,56 +3248,56 @@ macro _DOCS_YFM_USE_PLANTUML() { ### ### @see: [DOCS_DIR()](#macro_DOCS_DIR), [DOCS_CONFIG()](#macro_DOCS_CONFIG), [DOCS_VARS()](#macro_DOCS_VARS), [DOCS_BUILDER()](#macro_DOCS_BUILDER). multimodule DOCS { - module DOCSBOOK: _DOCS_BASE_UNIT { - .CMD=_DOCS_BOOK_CMD - .EPILOGUE=_DOCS_EPILOGUE + module DOCSBOOK: _DOCS_BASE_UNIT { + .CMD=_DOCS_BOOK_CMD + .EPILOGUE=_DOCS_EPILOGUE .FINAL_TARGET=yes - .PEERDIR_POLICY=as_build_from - - ENABLE(DOCSBOOK) - - SET(MODULE_TYPE PROGRAM) + .PEERDIR_POLICY=as_build_from + + ENABLE(DOCSBOOK) + + SET(MODULE_TYPE PROGRAM) SET(PEERDIR_TAGS DOCSLIB) SET(MODULE_TAG DOCBOOK) - - _DOCS_YFM_OUTPUT_FORMAT=$_DOCS_YFM_BOOK_OUTPUT_FORMAT - _DOCS_MKDOCS_CMDLINE_SUFFIX=$_DOCS_MKDOCS_BOOK_CMDLINE_SUFFIX - _DOCS_COMMON_PROCESS_DEPS=$_DOCS_COMMON_BOOK_PROCESS_DEPS - + + _DOCS_YFM_OUTPUT_FORMAT=$_DOCS_YFM_BOOK_OUTPUT_FORMAT + _DOCS_MKDOCS_CMDLINE_SUFFIX=$_DOCS_MKDOCS_BOOK_CMDLINE_SUFFIX + _DOCS_COMMON_PROCESS_DEPS=$_DOCS_COMMON_BOOK_PROCESS_DEPS + PROCESS_DOCS() } - - module DOCSLIB: _DOCS_BASE_UNIT { - .CMD=_DOCS_LIB_CMD - .EPILOGUE=_DOCS_EPILOGUE - .PEERDIR_POLICY=as_include - - ENABLE(DOCSLIB) - - SET(MODULE_TYPE LIBRARY) + + module DOCSLIB: _DOCS_BASE_UNIT { + .CMD=_DOCS_LIB_CMD + .EPILOGUE=_DOCS_EPILOGUE + .PEERDIR_POLICY=as_include + + ENABLE(DOCSLIB) + + SET(MODULE_TYPE LIBRARY) SET(PEERDIR_TAGS DOCSLIB) SET(MODULE_TAG DOCSLIB) - - REALPRJNAME=preprocessed - - _DOCS_YFM_OUTPUT_FORMAT=$_DOCS_YFM_LIB_OUTPUT_FORMAT - _DOCS_MKDOCS_CMDLINE_SUFFIX=$_DOCS_MKDOCS_LIB_CMDLINE_SUFFIX - _DOCS_COMMON_PROCESS_DEPS=$_DOCS_COMMON_LIB_PROCESS_DEPS - - PROCESS_DOCS() + + REALPRJNAME=preprocessed + + _DOCS_YFM_OUTPUT_FORMAT=$_DOCS_YFM_LIB_OUTPUT_FORMAT + _DOCS_MKDOCS_CMDLINE_SUFFIX=$_DOCS_MKDOCS_LIB_CMDLINE_SUFFIX + _DOCS_COMMON_PROCESS_DEPS=$_DOCS_COMMON_LIB_PROCESS_DEPS + + PROCESS_DOCS() } } # tag:docs -_DOCS_USE_PLANTUML= -### @usage: USE_PLANTUML() -### -### Use PlantUML plug-in for yfm builder to render UML diagrams into documentation -macro USE_PLANTUML() { - ENABLE(_DOCS_USE_PLANTUML) -} - -# tag:docs +_DOCS_USE_PLANTUML= +### @usage: USE_PLANTUML() +### +### Use PlantUML plug-in for yfm builder to render UML diagrams into documentation +macro USE_PLANTUML() { + ENABLE(_DOCS_USE_PLANTUML) +} + +# tag:docs DOCSBUILDER=yfm ### @usage: DOCS_BUILDER(tool) ### @@ -3306,7 +3306,7 @@ DOCSBUILDER=yfm ### ### @see: [DOCS](#multimodule_DOCS) macro DOCS_BUILDER(DocsTool) { - SET(_DOCS_BUILDER_VALUE $DocsTool) + SET(_DOCS_BUILDER_VALUE $DocsTool) } # tag:docs @@ -3317,12 +3317,12 @@ macro DOCS_BUILDER(DocsTool) { ### ### @see: [DOCS](#multimodule_DOCS) macro DOCS_DIR(Dir) { - SET(_DOCS_DIR_VALUE $Dir) + SET(_DOCS_DIR_VALUE $Dir) } # tag:docs -_DOCS_DEFAULT_CONFIG= -_DOCS_CONFIG_VALUE=$_DOCS_DEFAULT_CONFIG +_DOCS_DEFAULT_CONFIG= +_DOCS_CONFIG_VALUE=$_DOCS_DEFAULT_CONFIG ### @usage: DOCS_CONFIG(path) ### ### Specify path to config file for DOCS multimodule if it differs from default path. @@ -3332,11 +3332,11 @@ _DOCS_CONFIG_VALUE=$_DOCS_DEFAULT_CONFIG ### ### @see: [DOCS](#multimodule_DOCS) macro DOCS_CONFIG(File) { - SET(_DOCS_CONFIG_VALUE $File) + SET(_DOCS_CONFIG_VALUE $File) } # tag:docs -_DOCS_VARS_VALUE= +_DOCS_VARS_VALUE= ### @usage: DOCS_VARS(variable1=value1 variable2=value2 ...) ### ### Specify a set of default values of template variables for DOCS multimodule. @@ -3344,11 +3344,11 @@ _DOCS_VARS_VALUE= ### ### @see: [DOCS](#multimodule_DOCS) macro DOCS_VARS(Args...) { - SET_APPEND(_DOCS_VARS_VALUE $Args) + SET_APPEND(_DOCS_VARS_VALUE $Args) } # tag:docs -_DOCS_INCLUDE_SOURCES_VALUE= +_DOCS_INCLUDE_SOURCES_VALUE= ### @usage: DOCS_INCLUDE_SOURCES(path...) ### ### Specify a list of paths to source code files which will be used as text includes in a documentation project. @@ -3356,7 +3356,7 @@ _DOCS_INCLUDE_SOURCES_VALUE= ### ### @see: [DOCS](#multimodule_DOCS) macro DOCS_INCLUDE_SOURCES(Args...) { - SET_APPEND(_DOCS_INCLUDE_SOURCES_VALUE $Args) + SET_APPEND(_DOCS_INCLUDE_SOURCES_VALUE $Args) } # tag:python-specific @@ -3367,8 +3367,8 @@ PY_NAMESPACE_VALUE= ### ### Sets default Python namespace for all python sources in the module. ### Especially suitable in PROTO_LIBRARY where Python sources are generated and there is no PY_SRCS to place NAMESPACE parameter. -macro PY_NAMESPACE(Arg) { - SET(PY_NAMESPACE_VALUE $Arg) +macro PY_NAMESPACE(Arg) { + SET(PY_NAMESPACE_VALUE $Arg) } # tag:internal @@ -3409,9 +3409,9 @@ macro EMBED_JAVA_VCS_INFO() { ### PEERDIR it from JAVA_LIBRARY or JAVA_PROGRAM for export to Maven. module EXTERNAL_JAVA_LIBRARY: _BASE_UNIT { .EXTS=.jsrc .java .jar .mf - .NODE_TYPE=Bundle + .NODE_TYPE=Bundle .CMD=COMPILE_JAVA_MF - .PEERDIR_POLICY=as_build_from + .PEERDIR_POLICY=as_build_from .FINAL_TARGET=no .ALIASES=SRCS=_SRCS_NO_GLOBAL .ALLOWED=EMBED_JAVA_VCS_INFO @@ -3420,20 +3420,20 @@ module EXTERNAL_JAVA_LIBRARY: _BASE_UNIT { PEERDIR(build/platform/java/jdk) PEERDIR+=$JDK_RESOURCE_PEERDIR - PEERDIR_TAGS=JAVA_PROTO JAVA_FBS JAVA_IDL + PEERDIR_TAGS=JAVA_PROTO JAVA_FBS JAVA_IDL PROPAGATES_MANAGEABLE_PEERS=yes DYNAMIC_LINK=yes MACRO_ALIAS(PROTO_CMD _JAVA_PROTO_CMD) MACRO_ALIAS(EVLOG_CMD _JAVA_EVLOG_CMD) - MACRO_ALIAS(FBS_CMD _JAVA_FLATC_CMD) + MACRO_ALIAS(FBS_CMD _JAVA_FLATC_CMD) - when ($PACKAGE_PREFIX) { - PACKAGE_PREFIX_ARGS=--package-prefix=$PACKAGE_PREFIX - } + when ($PACKAGE_PREFIX) { + PACKAGE_PREFIX_ARGS=--package-prefix=$PACKAGE_PREFIX + } - DISABLE(NEED_PLATFORM_PEERDIRS) - NO_PLATFORM() - SET(MODULE_SUFFIX .jar) + DISABLE(NEED_PLATFORM_PEERDIRS) + NO_PLATFORM() + SET(MODULE_SUFFIX .jar) SET(MODULE_LANG JAVA) } @@ -3528,13 +3528,13 @@ module _JAR_BASE: _BARE_UNIT { .ALIASES=SRCS=_SRCS_NO_GLOBAL .ALLOWED=EMBED_JAVA_VCS_INFO DEPENDENCY_MANAGEMENT EXCLUDE - PEERDIR_TAGS=JAVA_PROTO JAVA_FBS JAVA_IDL DLL JAR_COMPILATION __EMPTY__ + PEERDIR_TAGS=JAVA_PROTO JAVA_FBS JAVA_IDL DLL JAR_COMPILATION __EMPTY__ HAS_MANAGEABLE_PEERS=yes DYNAMIC_LINK=yes MACRO_ALIAS(PROTO_CMD _JAVA_PROTO_CMD) MACRO_ALIAS(EVLOG_CMD _JAVA_EVLOG_CMD) - MACRO_ALIAS(FBS_CMD _JAVA_FLATC_CMD) + MACRO_ALIAS(FBS_CMD _JAVA_FLATC_CMD) DISABLE(NEED_PLATFORM_PEERDIRS) NO_PLATFORM() @@ -3557,9 +3557,9 @@ LOCAL_JAR_PATH= LOCAL_SOURCES_JAR_PATH= JAR_RESOURCE_ID= SRC_RESOURCE_ID= -FETCH_SRCS_JAR= +FETCH_SRCS_JAR= FETCH_TARGET_JAR= -FETCH_CONTRIB_JAR=$FETCH_TARGET_JAR $FETCH_SRCS_JAR +FETCH_CONTRIB_JAR=$FETCH_TARGET_JAR $FETCH_SRCS_JAR # tag:java-specific macro JAR_RESOURCE(Id) { @@ -3600,14 +3600,14 @@ module JAVA_CONTRIB: _JAR_BASE { } } when ($SRC_RESOURCE_ID) { - FETCH_SRCS_JAR= && $_FETCH_CONTRIB($SRC_RESOURCE_ID ${BINDIR}/${REALPRJNAME}-sources.jar) + FETCH_SRCS_JAR= && $_FETCH_CONTRIB($SRC_RESOURCE_ID ${BINDIR}/${REALPRJNAME}-sources.jar) } otherwise { when ($LOCAL_SOURCES_JAR_PATH) { - FETCH_SRCS_JAR= && $FS_TOOLS copy ${input:LOCAL_SOURCES_JAR_PATH} {output;pre=${BINDIR}/;suf=-sources.jar:REALPRJNAME} + FETCH_SRCS_JAR= && $FS_TOOLS copy ${input:LOCAL_SOURCES_JAR_PATH} {output;pre=${BINDIR}/;suf=-sources.jar:REALPRJNAME} } otherwise { - FETCH_SRCS_JAR= && $GENERATE_VCS_JAVA_INFO_NODEP && $FS_TOOLS md ${BINDIR}/fake-src && ${cwd;suf=/fake-src:BINDIR} $JDK_RESOURCE/bin/jar cfvm ${output;pre=${BINDIR}/;suf=-sources.jar:REALPRJNAME} $VCS_JAVA . + FETCH_SRCS_JAR= && $GENERATE_VCS_JAVA_INFO_NODEP && $FS_TOOLS md ${BINDIR}/fake-src && ${cwd;suf=/fake-src:BINDIR} $JDK_RESOURCE/bin/jar cfvm ${output;pre=${BINDIR}/;suf=-sources.jar:REALPRJNAME} $VCS_JAVA . PEERDIR+=build/platform/java/jdk PEERDIR+=$JDK_RESOURCE_PEERDIR } @@ -4033,12 +4033,12 @@ module PY2_LIBRARY: _LIBRARY { when ($NO_PYTHON_INCLS != "yes") { PEERDIR+=contrib/libs/python } - when ($MSVC == "yes" || $CYGWIN == "yes") { - MODULE_PREFIX=py - } - otherwise { - MODULE_PREFIX=libpy - } + when ($MSVC == "yes" || $CYGWIN == "yes") { + MODULE_PREFIX=py + } + otherwise { + MODULE_PREFIX=libpy + } .ALLOWED=FORK_TESTS .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER USE_PYTHON2 .RESTRICTED=PYTHON3_ADDINCL USE_PYTHON3 PYTHON2_ADDINCL OPTIMIZE_PY_PROTOS NO_OPTIMIZE_PY_PROTOS @@ -4069,7 +4069,7 @@ module _PY3_LIBRARY: _LIBRARY { MODULE_PREFIX=libpy } .ALLOWED=FORK_TESTS - .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER + .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER .RESTRICTED=PYTHON3_ADDINCL USE_PYTHON3 PYTHON2_ADDINCL USE_PYTHON2 OPTIMIZE_PY_PROTOS NO_OPTIMIZE_PY_PROTOS USE_GLOBAL_CMD=yes @@ -4115,36 +4115,36 @@ module _BASE_PY_PROGRAM: _BASE_PROGRAM { NO_CHECK_IMPORTS_FOR_VALUE= } ADD_CHECK_PY_IMPORTS() - + when ($NO_PYTHON_INCLS != "yes") { PEERDIR += contrib/libs/python } - when ($USE_ARCADIA_PYTHON == "yes") { + when ($USE_ARCADIA_PYTHON == "yes") { PEERDIR += library/python/runtime/main PEERDIR += contrib/python/subprocess32 when ($PYTHON_SQLITE3 != "no") { PEERDIR += contrib/tools/python/src/Modules/_sqlite } - } + } when ($PYTHON_COVERAGE == "yes") { PEERDIR+=library/python/coverage } - - when ($ARCH_PPC64LE == "yes") { - _MY_ALLOCATOR=SYSTEM - } - otherwise { - _MY_ALLOCATOR=J - } - ALLOCATOR($_MY_ALLOCATOR) - STRIP() - + + when ($ARCH_PPC64LE == "yes") { + _MY_ALLOCATOR=SYSTEM + } + otherwise { + _MY_ALLOCATOR=J + } + ALLOCATOR($_MY_ALLOCATOR) + STRIP() + when ($BUILD_TYPE == "DEBUG") { NO_STRIP=yes } - when ($SANITIZER_TYPE && $SANITIZER_TYPE != "no") { - NO_STRIP=yes - } + when ($SANITIZER_TYPE && $SANITIZER_TYPE != "no") { + NO_STRIP=yes + } .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER USE_PYTHON2 .RESTRICTED=PYTHON3_ADDINCL USE_PYTHON3 PYTHON2_ADDINCL OPTIMIZE_PY_PROTOS NO_OPTIMIZE_PY_PROTOS SET(MODULE_LANG PY2) @@ -4180,14 +4180,14 @@ module _BASE_PY3_PROGRAM: _BASE_PROGRAM { NO_CHECK_IMPORTS_FOR_VALUE= } ADD_CHECK_PY_IMPORTS() - - when ($ARCH_PPC64LE == "yes") { - _MY_ALLOCATOR=SYSTEM - } - otherwise { - _MY_ALLOCATOR=J - } - ALLOCATOR($_MY_ALLOCATOR) + + when ($ARCH_PPC64LE == "yes") { + _MY_ALLOCATOR=SYSTEM + } + otherwise { + _MY_ALLOCATOR=J + } + ALLOCATOR($_MY_ALLOCATOR) STRIP() when ($NO_PYTHON_INCLS != "yes") { @@ -4428,7 +4428,7 @@ REAL_SWIG_DLL_JAR_CMD=$GENERATE_VCS_JAVA_INFO_NODEP && ${cwd:ARCADIA_BUILD_ROOT} ### ### https://wiki.yandex-team.ru/robot/manual/kiwi/techdoc/design/metaquery/ module METAQUERY: _BASE_UNIT { - .ALL_INS_TO_OUT=yes + .ALL_INS_TO_OUT=yes .FINAL_TARGET=yes PRINT_MODULE_TYPE(METAQUERY $MODULE_PREFIX$REALPRJNAME) } @@ -4442,8 +4442,8 @@ SYSTEM_PROPERTIES_VALUE= ### FILE means that parst should be read from file specifies as Path. ### ### Documentation: https://wiki.yandex-team.ru/yatool/test/ -macro SYSTEM_PROPERTIES(Args...) { - SET_APPEND(SYSTEM_PROPERTIES_VALUE $Args) +macro SYSTEM_PROPERTIES(Args...) { + SET_APPEND(SYSTEM_PROPERTIES_VALUE $Args) } # tag:java-specific @@ -4453,8 +4453,8 @@ JVM_ARGS_VALUE= ### Arguments to run Java programs in tests. ### ### Documentation: https://wiki.yandex-team.ru/yatool/test/ -macro JVM_ARGS(Args...) { - SET_APPEND(JVM_ARGS_VALUE $Args) +macro JVM_ARGS(Args...) { + SET_APPEND(JVM_ARGS_VALUE $Args) } # tag:java-specific @@ -4464,8 +4464,8 @@ CHECK_JAVA_DEPS_VALUE= ### Check for different classes with duplicate name in classpath. ### ### Documentation: https://wiki.yandex-team.ru/yatool/test/ -macro CHECK_JAVA_DEPS(Arg) { - SET(CHECK_JAVA_DEPS_VALUE $Arg) +macro CHECK_JAVA_DEPS(Arg) { + SET(CHECK_JAVA_DEPS_VALUE $Arg) } ERROR_PRONE_VALUE= @@ -4483,8 +4483,8 @@ TEST_CWD_VALUE= ### Is only used inside of the TEST modules. ### ### Documentation: https://wiki.yandex-team.ru/yatool/test/ -macro TEST_CWD(Arg) { - SET(TEST_CWD_VALUE $Arg) +macro TEST_CWD(Arg) { + SET(TEST_CWD_VALUE $Arg) } # tag:java-specific @@ -4615,8 +4615,8 @@ IDEA_EXCLUDE_DIRS_VALUE= ### ### Exclude specified directories from an idea project generated by ya ide idea ### Have no effect on regular build. -macro IDEA_EXCLUDE_DIRS(Args...) { - SET_APPEND(IDEA_EXCLUDE_DIRS_VALUE $Args) +macro IDEA_EXCLUDE_DIRS(Args...) { + SET_APPEND(IDEA_EXCLUDE_DIRS_VALUE $Args) } # tag:idea-specific @@ -4644,9 +4644,9 @@ JAVAC_FLAGS_VALUE= ### @usage: JAVAC_FLAGS(Args...) ### ### Set additional Java compilation flags. -macro JAVAC_FLAGS(Args...) { +macro JAVAC_FLAGS(Args...) { SET_APPEND(JAVAC_OPTS $Args) - SET_APPEND(JAVAC_FLAGS_VALUE $ARGS_DELIM $Args) + SET_APPEND(JAVAC_FLAGS_VALUE $ARGS_DELIM $Args) } # tag:java-specific @@ -4687,8 +4687,8 @@ ANNOTATION_PROCESSOR_VALUE= ### ### The macro is in development. ### Used to specify annotation processors to build JAVA_PROGRAM() and JAVA_LIBRARY(). -macro ANNOTATION_PROCESSOR(Args...) { - SET_APPEND(ANNOTATION_PROCESSOR_VALUE $ARGS_DELIM $Args) +macro ANNOTATION_PROCESSOR(Args...) { + SET_APPEND(ANNOTATION_PROCESSOR_VALUE $ARGS_DELIM $Args) } EXCLUDE_VALUE= @@ -4696,8 +4696,8 @@ EXCLUDE_VALUE= ### ### The macro is in development. ### Specifies which libraries should be excluded from the classpath. -macro EXCLUDE(Args...) { - SET_APPEND(EXCLUDE_VALUE $ARGS_DELIM $Args) +macro EXCLUDE(Args...) { + SET_APPEND(EXCLUDE_VALUE $ARGS_DELIM $Args) } # tag:java-specific @@ -4726,14 +4726,14 @@ JAVA_SRCS_VALUE= ### } ### ### Documentation: https://wiki.yandex-team.ru/yatool/java/#javasrcs -macro JAVA_SRCS(Args...) { - SET_APPEND(JAVA_SRCS_VALUE $ARGS_DELIM $Args) +macro JAVA_SRCS(Args...) { + SET_APPEND(JAVA_SRCS_VALUE $ARGS_DELIM $Args) } # tag:java-specific JAVA_ADD_DLLS_VALUE=no -macro ADD_DLLS_TO_JAR() { - SET(JAVA_ADD_DLLS_VALUE yes) +macro ADD_DLLS_TO_JAR() { + SET(JAVA_ADD_DLLS_VALUE yes) } # tag:java-specific @@ -4770,8 +4770,8 @@ DEPENDENCY_MANAGEMENT_VALUE= ### If some module has both DEPENDENCY_MANAGEMENT(contrib/java/junit/junit/4.12) and PERDIR(contrib/java/junit/junit/4.11), the PEERDIR wins. ### ### Documentation: https://wiki.yandex-team.ru/yatool/java/ -macro DEPENDENCY_MANAGEMENT(Args...) { - SET_APPEND(DEPENDENCY_MANAGEMENT_VALUE $ARGS_DELIM $Args) +macro DEPENDENCY_MANAGEMENT(Args...) { + SET_APPEND(DEPENDENCY_MANAGEMENT_VALUE $ARGS_DELIM $Args) _GHOST_PEERDIR($Args) } @@ -4858,13 +4858,13 @@ macro JAVA_EXTERNAL_DEPENDENCIES(Args...) { ### @usage _JAVA_PLACEHOLDER #internal ### The base module for all Java modules. Defines common properties and dependencies. module _JAVA_PLACEHOLDER: _BASE_UNIT { - .CMD=TOUCH_JAVA_UNIT + .CMD=TOUCH_JAVA_UNIT .FINAL_TARGET=yes .ALLOWED=DEPENDENCY_MANAGEMENT EXCLUDE .ALIASES=RUN_JAVA_PROGRAM=_RUN_JBUILD_PROGRAM HAS_MANAGEABLE_PEERS=yes DYNAMIC_LINK=yes - PEERDIR_TAGS=JAVA_PROTO JAVA_FBS JAVA_IDL JAR_COMPILATION + PEERDIR_TAGS=JAVA_PROTO JAVA_FBS JAVA_IDL JAR_COMPILATION PEERDIR(build/platform/java/jdk) PEERDIR+=$JDK_RESOURCE_PEERDIR when($MAKE_UBERJAR_VALUE) { @@ -4901,9 +4901,9 @@ module _JAVA_PLACEHOLDER: _BASE_UNIT { } JAVA_DEPENDENCIES_CONFIGURATION(FORBID_DEFAULT_VERSIONS) - DISABLE(NEED_PLATFORM_PEERDIRS) - NO_PLATFORM() - JAVA_MODULE() + DISABLE(NEED_PLATFORM_PEERDIRS) + NO_PLATFORM() + JAVA_MODULE() # flatbuffers-java DEPENDENCY_MANAGEMENT(contrib/java/com/google/flatbuffers/flatbuffers-java/${JAVA_FLATBUFFERS_VERSION}) @@ -5119,18 +5119,18 @@ macro _ARCADIA_PYTHON_ADDINCL() { macro _PYTHON_ADDINCL() { SET(PYTHON2 yes) SET(PYTHON3 no) - when ($USE_ARCADIA_PYTHON == "yes") { + when ($USE_ARCADIA_PYTHON == "yes") { ADDINCL+=GLOBAL contrib/libs/python/Include CFLAGS+=-DARCADIA_PYTHON_UNICODE_SIZE=$ARCADIA_PYTHON_UNICODE_SIZE - } - otherwise { + } + otherwise { when ($USE_SYSTEM_PYTHON) { PEERDIR+=build/platform/python } otherwise { CFLAGS+=$PYTHON_INCLUDE } - } + } } # tag:python-specific @@ -5169,18 +5169,18 @@ macro _ARCADIA_PYTHON3_ADDINCL() { macro _PYTHON3_ADDINCL() { SET(PYTHON3 yes) SET(PYTHON2 no) - when ($USE_ARCADIA_PYTHON == "yes") { + when ($USE_ARCADIA_PYTHON == "yes") { CFLAGS+=-DUSE_PYTHON3 ADDINCL+=GLOBAL contrib/libs/python/Include - } - otherwise { + } + otherwise { when ($USE_SYSTEM_PYTHON) { PEERDIR+=build/platform/python } otherwise { CFLAGS+=$PYTHON_INCLUDE } - } + } } # tag:python-specific @@ -5226,12 +5226,12 @@ when ($PERL_DEFAULT_PEERDIR == "yes") { when (($PERLXS == "yes") || ($PERLXSCPP == "yes") || ($USE_PERL == "yes")) { PEERDIR+=build/platform/perl } -} +} # tag:perl-specific ### @usage: USE_PERL_LIB() ### Add dependency on Perl to your LIBRARY -macro USE_PERL_LIB() { +macro USE_PERL_LIB() { PEERDIR(build/platform/perl) } @@ -5277,14 +5277,14 @@ macro ADD_PERL_MODULE(Dir, Module) { ### - FAKE - Don't link with any allocator ### ### More about allocators in Arcadia: https://wiki.yandex-team.ru/arcadia/allocators/ -macro ALLOCATOR(Alloc) { - SET(ALLOCATOR $Alloc) - +macro ALLOCATOR(Alloc) { + SET(ALLOCATOR $Alloc) + when ($ALLOCATOR in [ "LF", "LF_YT", "LF_DBG", "YT", "J", "B", "BM", "C", "TCMALLOC", "TCMALLOC_SMALL_BUT_SLOW", "TCMALLOC_NUMA_256K", "TCMALLOC_NUMA_LARGE_PAGES", "TCMALLOC_256K", "GOOGLE", "LOCKLESS", "SYSTEM", "FAKE", "MIM", "HU" ]) { - } - otherwise { - PEERDIR+=___configure_error___unknown_allocator_type___$ALLOCATOR - } + } + otherwise { + PEERDIR+=___configure_error___unknown_allocator_type___$ALLOCATOR + } } ### @usage: CC_REQUIREMENTS([cpu: <value>] [ram: <value>]) @@ -5328,24 +5328,24 @@ macro PY_REQUIREMENTS(reqs) { SET_APPEND(PY_REQUIREMENTS $reqs) } -when ($MIC_ARCH == "yes") { - CFLAGS+=-mmic - LDFLAGS+=-mmic -} -when ($USE_OPENMP == "yes") { - PEERDIR+=contrib/libs/openmp -} +when ($MIC_ARCH == "yes") { + CFLAGS+=-mmic + LDFLAGS+=-mmic +} +when ($USE_OPENMP == "yes") { + PEERDIR+=contrib/libs/openmp +} -when ($STRIP == "yes" && $NO_STRIP != "yes") { - STRIP_FLAG=$LD_STRIP_FLAG - DWARF_COMMAND= - GO_LINK_FLAGS_VALUE+=-s -} +when ($STRIP == "yes" && $NO_STRIP != "yes") { + STRIP_FLAG=$LD_STRIP_FLAG + DWARF_COMMAND= + GO_LINK_FLAGS_VALUE+=-s +} when ($NO_LINKER_DCE != "yes") { DCE_FLAG=$LD_DCE_FLAG } - + when ($BT_MINSIZEREL == "yes" || $LINKER_ICF == "yes") { ICF_FLAG=$LD_ICF_FLAG } @@ -5364,9 +5364,9 @@ when (!$STRIP_TOOL_VENDOR) { NEED_BINUTILS_PEERDIR=yes } -SPLIT_DWARF_VALUE=no -NO_SPLIT_DWARF=no - +SPLIT_DWARF_VALUE=no +NO_SPLIT_DWARF=no + when ($STRIP_DEBUG_INFO) { SPLIT_DWARF_VALUE=yes NO_SPLIT_DWARF=no @@ -5376,32 +5376,32 @@ when ($STRIP_DEBUG_INFO) { ### ### Emit debug info for the PROGRAM/DLL as a separate file <module_name>.debug. ### NB: It does not help you to save process RSS but can add problems (see e.g. BEGEMOT-2147). -macro SPLIT_DWARF() { - SET(SPLIT_DWARF_VALUE yes) -} - -SPLIT_DWARF_OUTPUT=${output;tobindir;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX.debug:REALPRJNAME} -when ($SPLIT_DWARF_VALUE == "yes" && $NO_SPLIT_DWARF != "yes" && $NO_DEBUGINFO != "yes" && $HOST_OS_LINUX == "yes" && $TARGET_PLATFORM == "LINUX") { +macro SPLIT_DWARF() { + SET(SPLIT_DWARF_VALUE yes) +} + +SPLIT_DWARF_OUTPUT=${output;tobindir;pre=$MODULE_PREFIX;suf=$MODULE_SUFFIX.debug:REALPRJNAME} +when ($SPLIT_DWARF_VALUE == "yes" && $NO_SPLIT_DWARF != "yes" && $NO_DEBUGINFO != "yes" && $HOST_OS_LINUX == "yes" && $TARGET_PLATFORM == "LINUX") { DWARF_COMMAND+= \ - $OBJCOPY_TOOL --only-keep-debug $TARGET $SPLIT_DWARF_OUTPUT && \ + $OBJCOPY_TOOL --only-keep-debug $TARGET $SPLIT_DWARF_OUTPUT && \ $STRIP_TOOL --strip-debug $TARGET && \ $OBJCOPY_TOOL --remove-section=.gnu_debuglink --add-gnu-debuglink $SPLIT_DWARF_OUTPUT $TARGET BINUTILS_USED=yes -} - +} + ### @usage: EXTRALIBS_STATIC(Libs...) ### ### Add the specified external static libraries to the program link -macro EXTRALIBS_STATIC(Args...) { - LDFLAGS(-Wl,-Bstatic ${Args} -Wl,-Bdynamic) +macro EXTRALIBS_STATIC(Args...) { + LDFLAGS(-Wl,-Bstatic ${Args} -Wl,-Bdynamic) } ### @usage ADD_COMPILABLE_TRANSLATE(Dict Name Options...) ### ### Generate translation dictionary code to transdict.LOWER(Name).cpp that will than be compiled into library -macro ADD_COMPILABLE_TRANSLATE(Dict, Name, MakeTransDictOptions...) { - __translatename_lower=${tolower:Name} - __translate_dict=${BINDIR}/transdict.${__translatename_lower}.cpp +macro ADD_COMPILABLE_TRANSLATE(Dict, Name, MakeTransDictOptions...) { + __translatename_lower=${tolower:Name} + __translate_dict=${BINDIR}/transdict.${__translatename_lower}.cpp RUN_PROGRAM(dict/tools/maketransdict -i ${Dict} ${MakeTransDictOptions} ${Name} STDOUT_NOAUTO ${__translate_dict} IN ${Dict}) } @@ -5409,8 +5409,8 @@ macro ADD_COMPILABLE_TRANSLATE(Dict, Name, MakeTransDictOptions...) { ### ### Generate transliteration dictionary code ### This will emit both translit, untranslit and ngrams table codes those will be than further compiled into library -macro ADD_COMPILABLE_TRANSLIT(TranslitTable, NGrams, Name, Options...) { - __translitname_lower=${tolower:Name} +macro ADD_COMPILABLE_TRANSLIT(TranslitTable, NGrams, Name, Options...) { + __translitname_lower=${tolower:Name} __translit_table=${BINDIR}/translit_trie_${__translitname_lower}.cpp __untranslit_table=${BINDIR}/untranslit_trie_${__translitname_lower}.cpp __ngrams_table=${BINDIR}/ngr_arr_${__translitname_lower}.cpp @@ -5427,10 +5427,10 @@ macro ADD_COMPILABLE_TRANSLIT(TranslitTable, NGrams, Name, Options...) { ### ### Generate python bindings for protobuf files. ### Macro is obsolete and not recommended for use! -macro GENERATE_PY_PROTOS(FILES...) { - foreach (FILE : $FILES) { +macro GENERATE_PY_PROTOS(FILES...) { + foreach (FILE : $FILES) { _PY_PROTO_CMD($FILE) - } + } } # tag:python-specific tag:proto @@ -5450,33 +5450,33 @@ macro _GENERATE_PY_EVS_INTERNAL(FILES...) { macro _COPY_FILE_IMPL(FILE, AUTO_DST="", NOAUTO_DST="", OUTPUT_INCLUDES[], REQUIREMENTS[]) { .CMD=$COPY_CMD ${input:FILE} ${output:AUTO_DST} ${output;noauto:NOAUTO_DST} ${output_include;hide:OUTPUT_INCLUDES} ${requirements;hide:REQUIREMENTS} ${kv;hide:"p CP"} ${kv;hide:"pc light-cyan"} .SEM=copy_file ${input:FILE} ${output:AUTO_DST} ${output;noauto:NOAUTO_DST} -} - -### @usage: COPY_FILE(File Destination [AUTO] [OUTPUT_INCLUDES Deps...]) +} + +### @usage: COPY_FILE(File Destination [AUTO] [OUTPUT_INCLUDES Deps...]) ### ### Copy file to build root. It is possible to change both location and the name. -### -### Parameters: -### - File - Source file name. -### - Destination - Output file name. -### - AUTO - Consider copied file for further processing automtically. -### - OUTPUT_INCLUDES output_includes... - Output file dependencies. -### -### The file will be just copied if AUTO boolean parameter is not specified. You should explicitly -### mention it in SRCS under new name (or specify AUTO boolean parameter) for further processing. +### +### Parameters: +### - File - Source file name. +### - Destination - Output file name. +### - AUTO - Consider copied file for further processing automtically. +### - OUTPUT_INCLUDES output_includes... - Output file dependencies. +### +### The file will be just copied if AUTO boolean parameter is not specified. You should explicitly +### mention it in SRCS under new name (or specify AUTO boolean parameter) for further processing. macro COPY_FILE(File, Destination, AUTO?"AUTO_DST":"NOAUTO_DST", OUTPUT_INCLUDES[], REQUIREMENTS[]) { .CMD=$_COPY_FILE_IMPL($File $AUTO $Destination OUTPUT_INCLUDES $OUTPUT_INCLUDES REQUIREMENTS $REQUIREMENTS) .SEM=$_COPY_FILE_IMPL($File $AUTO $Destination OUTPUT_INCLUDES $OUTPUT_INCLUDES REQUIREMENTS $REQUIREMENTS) -} - -### @usage: COPY_FILE_WITH_CONTEXT(FILE DEST [AUTO] [OUTPUT_INCLUDES DEPS...]) -### -### Copy file to build root the same way as it is done for COPY_FILE, but also -### propagates the context of the source file. -macro COPY_FILE_WITH_CONTEXT(FILE, DEST, AUTO?"AUTO":"", OUTPUT_INCLUDES[]) { - .CMD=$COPY_FILE($FILE $DEST $AUTO OUTPUT_INCLUDES $FILE $OUTPUT_INCLUDES) -} - +} + +### @usage: COPY_FILE_WITH_CONTEXT(FILE DEST [AUTO] [OUTPUT_INCLUDES DEPS...]) +### +### Copy file to build root the same way as it is done for COPY_FILE, but also +### propagates the context of the source file. +macro COPY_FILE_WITH_CONTEXT(FILE, DEST, AUTO?"AUTO":"", OUTPUT_INCLUDES[]) { + .CMD=$COPY_FILE($FILE $DEST $AUTO OUTPUT_INCLUDES $FILE $OUTPUT_INCLUDES) +} + macro _BUNDLE_TARGET(Target, Destination) { .CMD=$MOVE_FILE ${result:Target} ${output;noauto:Destination} ${kv;hide:"p BN"} ${kv;hide:"pc light-cyan"} $VCS_INFO_DISABLE_CACHE__NO_UID__ } @@ -5486,8 +5486,8 @@ macro _BUNDLE_TARGET(Target, Destination) { ### Sets a timeout on test execution ### ### Documentation about the system test: https://wiki.yandex-team.ru/yatool/test/ -macro TIMEOUT(Time) { - SET(TEST_TIMEOUT $Time) +macro TIMEOUT(Time) { + SET(TEST_TIMEOUT $Time) } SBR_UID_EXT="" @@ -5514,7 +5514,7 @@ TEST_PARTITION=SEQUENTIAL ### ### Documentation about the system test: https://wiki.yandex-team.ru/yatool/test/ macro FORK_TESTS(MODE...) { - SET(TEST_FORK_MODE tests) + SET(TEST_FORK_MODE tests) SET(TEST_PARTITION $MODE) } @@ -5528,7 +5528,7 @@ macro FORK_TESTS(MODE...) { ### ### Documentation about the system test: https://wiki.yandex-team.ru/yatool/test/ macro FORK_SUBTESTS(MODE...) { - SET(TEST_FORK_MODE subtests) + SET(TEST_FORK_MODE subtests) SET(TEST_PARTITION $MODE) } @@ -5541,8 +5541,8 @@ macro FORK_SUBTESTS(MODE...) { ### Supports C++ ut and PyTest. ### ### Documentation about the system test: https://wiki.yandex-team.ru/yatool/test/ -macro SPLIT_FACTOR(Factor) { - SET(TEST_SPLIT_FACTOR $Factor) +macro SPLIT_FACTOR(Factor) { + SET(TEST_SPLIT_FACTOR $Factor) } # tag:test @@ -5553,8 +5553,8 @@ FORK_TEST_FILES_MODE= ### Compatible with FORK_(SUB)TESTS. ### ### Documentation about the system test: https://wiki.yandex-team.ru/yatool/test/ -macro FORK_TEST_FILES() { - SET(FORK_TEST_FILES_MODE on) +macro FORK_TEST_FILES() { + SET(FORK_TEST_FILES_MODE on) } # tag:test @@ -5565,8 +5565,8 @@ TEST_SIZE_NAME=SMALL ### See documentation on test system for more details. ### ### Documentation about the system test: https://wiki.yandex-team.ru/yatool/test/ -macro SIZE(Type) { - SET(TEST_SIZE_NAME $Type) +macro SIZE(Type) { + SET(TEST_SIZE_NAME $Type) } ### @usage: JOIN_SRCS(Out Src...) @@ -5574,7 +5574,7 @@ macro SIZE(Type) { ### Join set of sources into single file named Out and send it for further processing. ### This macro doesn't place all file into Out, it emits #include<Src>... Use the for C++ source files only. ### You should specify file name with the extension as Out. Futher processing will be done according this extension. -macro JOIN_SRCS(Out, Src...) { +macro JOIN_SRCS(Out, Src...) { .CMD=$YMAKE_PYTHON ${input:"build/scripts/gen_join_srcs.py"} ${output:Out} --ya-start-command-file ${input;rootrel:Src} --ya-end-command-file ${output_include;hide:Src} ${kv;hide:"p JS"} ${kv;hide:"pc magenta"} .SEM=target_joined_source $Out ${input:Src} ${output;hide;suf=.o:Out} && modules_required yandex_common.cmake _CONDITIONAL_SRCS($TIDY_VALUE $Src) @@ -5602,16 +5602,16 @@ macro FLAT_JOIN_SRCS_GLOBAL(Out, Src...) { # tag:cpu PIC_CFLAGS= -SSE2_CFLAGS= -SSE3_CFLAGS= -SSSE3_CFLAGS= -SSE41_CFLAGS= +SSE2_CFLAGS= +SSE3_CFLAGS= +SSSE3_CFLAGS= +SSE41_CFLAGS= SSE42_CFLAGS= POPCNT_CFLAGS= PCLMUL_CFLAGS= CX16_FLAGS= -AVX_CFLAGS= -AVX2_CFLAGS= +AVX_CFLAGS= +AVX2_CFLAGS= AVX512_CFLAGS= # tag:cpu @@ -5654,9 +5654,9 @@ when (($ARCH_X86_64 || $ARCH_I386) && $DISABLE_INSTRUCTION_SETS != "yes") { SSE4_DEFINES=-DSSE41_ENABLED=1 -DSSE42_ENABLED=1 -DPOPCNT_ENABLED=1 -DCX16_ENABLED=1 } elsewhen ($MSVC) { - SSE2_CFLAGS=/D__SSE2__=1 - SSE3_CFLAGS=/D__SSE3__=1 - SSSE3_CFLAGS=/D__SSSE3__=1 + SSE2_CFLAGS=/D__SSE2__=1 + SSE3_CFLAGS=/D__SSE3__=1 + SSSE3_CFLAGS=/D__SSSE3__=1 SSE41_CFLAGS=/D__SSE4_1__=1 SSE42_CFLAGS=/D__SSE4_2__=1 POPCNT_CFLAGS=/D__POPCNT__=1 @@ -5666,18 +5666,18 @@ when (($ARCH_X86_64 || $ARCH_I386) && $DISABLE_INSTRUCTION_SETS != "yes") { AVX512_CFLAGS=/arch:AVX512 /DAVX512_ENABLED=1 SSE_DEFINES=/DSSE_ENABLED=1 /DSSE3_ENABLED=1 /DSSSE3_ENABLED=1 SSE4_DEFINES=/DSSE41_ENABLED=1 /DSSE42_ENABLED=1 /DPOPCNT_ENABLED=1 /DCX16_ENABLED=1 - } + } SSE_CFLAGS=$SSE2_CFLAGS $SSE3_CFLAGS $SSSE3_CFLAGS SSE4_CFLAGS=$SSE41_CFLAGS $SSE42_CFLAGS $POPCNT_CFLAGS $CX16_FLAGS when ($ARCH_I386 && $OS_ANDROID == "yes") { USE_SSE4=no } -} +} otherwise { USE_SSE4=no CPU_CHECK=no } - + # tag:cpu when ($NOSSE == "yes") { USE_SSE4=no @@ -5699,9 +5699,9 @@ macro NO_CPU_CHECK() { SET(CPU_CHECK no) } -### @usage: ADDINCLSELF() -### -### The macro adds the -I<project source path> flag to the source compilation flags of the current project. +### @usage: ADDINCLSELF() +### +### The macro adds the -I<project source path> flag to the source compilation flags of the current project. macro ADDINCLSELF(FOR="") { when($FOR) { ADDINCL+=FOR $FOR ${MODDIR} @@ -5709,8 +5709,8 @@ macro ADDINCLSELF(FOR="") { otherwise { ADDINCL+=${MODDIR} } -} - +} + COMPILE_OUT_SUFFIX= _COMPILE_OUTPUTS=${output;suf=${COMPILE_OUT_SUFFIX}${OBJECT_SUF}:SRC} _COMPILE_TIME_TRACE_OUTPUTS=${output;noauto;suf=${COMPILE_OUT_SUFFIX}${OBJECT_SUF}.time_trace.json:SRC} @@ -5720,8 +5720,8 @@ macro SET_COMPILE_OUTPUTS_MODIFIERS(NOREL?";norel":"") { SET(_COMPILE_TIME_TRACE_OUTPUTS \${output;noauto;suf=\${OBJECT_SUF}.time_trace.json$NOREL:SRC}) } -_EMPTY_CMD= - +_EMPTY_CMD= + # tag:src-processing tag:internal ### @usage: _SRC(Ext Src Flags) # internal ### @@ -5729,216 +5729,216 @@ _EMPTY_CMD= ### To enable specific extension processing define _SRC() macro with fixed first argument (Ext). ### Internal logic will apply this macro to all files with this Ext listed in SRC/SRCS macros or outputs ### of other commands (except ones marked as noauto) -macro _SRC(EXT, SRC, SRCFLAGS...) { +macro _SRC(EXT, SRC, SRCFLAGS...) { # Generic macro definition for _SRC (just a placeholder, it does nothing) -} - +} + # tag:src-processing -macro _SRC("S", SRC, SRCFLAGS...) { +macro _SRC("S", SRC, SRCFLAGS...) { .CMD=$C_COMPILER $C_FLAGS_PLATFORM $CFLAGS $SFLAGS $SRCFLAGS -c -o ${output:SRC.o} ${input:SRC} ${pre=-I:_C__INCLUDE} .SEM=add_asm_source ${input:SRC} ${output;hide;suf=.o:SRC} -} - +} + # tag:src-processing -macro _SRC("s", SRC, SRCFLAGS...) { - .CMD=$_SRC(S, $SRC $SRCFLAGS) -} - +macro _SRC("s", SRC, SRCFLAGS...) { + .CMD=$_SRC(S, $SRC $SRCFLAGS) +} + # tag:src-processing macro _SRC("s79", SRC, SRCFLAGS...) { .CMD=$_SRC(S, $SRC $SRCFLAGS -x assembler-with-cpp) } # tag:src-processing -macro _SRC("mm", SRC, SRCFLAGS...) { +macro _SRC("mm", SRC, SRCFLAGS...) { .CMD=$C_COMPILER $C_FLAGS_PLATFORM -x objective-c++ -fobjc-arc -fobjc-abi-version=2 -c -o ${output:SRC.o} ${input:SRC} $CXXFLAGS ${pre=-I:_C__INCLUDE} ${SRCFLAGS} ${requirements;hide:CC_REQUIREMENTS} ${kv;hide:"p CC"} ${kv;hide:"pc light-green"} $TOOLCHAIN_ENV -} - +} + # tag:src-processing -macro _SRC("fml", SRC, SRCFLAGS...) { - .CMD=$FML_TOOL $CHECKFLAG -b -o ${output:SRC.inc} -T ${input:SRC} ${SRCFLAGS} ${kv;hide:"p FM"} ${kv;hide:"pc yellow"} -} - +macro _SRC("fml", SRC, SRCFLAGS...) { + .CMD=$FML_TOOL $CHECKFLAG -b -o ${output:SRC.inc} -T ${input:SRC} ${SRCFLAGS} ${kv;hide:"p FM"} ${kv;hide:"pc yellow"} +} + # tag:src-processing -macro _SRC("fml2", SRC, SRCFLAGS...) { +macro _SRC("fml2", SRC, SRCFLAGS...) { .CMD=$FML_TOOL $CHECKFLAG -b -o ${output;nopath;noext:SRC.fml.inc} -2 -O ${output;nopath;noext:SRC.fml.cpp} -T ${input:SRC} ${SRCFLAGS} ${kv;hide:"p FM"} ${kv;hide:"pc yellow"} -} - +} + # tag:src-processing -macro _SRC("fml3", SRC, SRCFLAGS...) { +macro _SRC("fml3", SRC, SRCFLAGS...) { .CMD=$FML_TOOL $CHECKFLAG -b -o ${output;nopath;noext:SRC.fml.inc} -3 -O ${output;nopath;noext:SRC.fml.cpp} -L ${input;nopath;noext:SRC.list} -P ${nopath;noext:SRC} -T ${input:SRC} ${SRCFLAGS} ${kv;hide:"p FM"} ${kv;hide:"pc yellow"} -} - +} + # tag:src-processing -macro _SRC("sfdl", SRC, SRCFLAGS...) { +macro _SRC("sfdl", SRC, SRCFLAGS...) { .CMD=$CXX_COMPILER $C_FLAGS_PLATFORM $CXXFLAGS $SFDL_FLAG ${SRCFLAGS} ${input:SRC} && ${tool:"tools/calcstaticopt"} -i ${tmp:SRC.tmp} -a $ARCADIA_ROOT ${output;stdout;nopath;noext;defext=.inc:SRC} ${kv;hide:"p SF"} ${kv;hide:"pc yellow"} $TOOLCHAIN_ENV -} - +} + # tag:src-processing -macro _SRC("xs", SRC, SRCFLAGS...) { +macro _SRC("xs", SRC, SRCFLAGS...) { .CMD=$PERL_LD_LIBRARY_PATH $PERL $PERL_INCLUDE ${suf=/ExtUtils/xsubpp:PERL_PRIVLIB} -typemap ${suf=/ExtUtils/typemap:PERL_PRIVLIB} $PERLSUFFIX $XSUBPPFLAGS ${SRCFLAGS} ${input:SRC} $PERLOUTPUT ${kv;hide:"p XS"} ${kv;hide:"pc yellow"} -} - +} + # tag:src-processing -macro _SRC("y", SRC, SRCFLAGS...) { +macro _SRC("y", SRC, SRCFLAGS...) { # .CMD=${tool:"contrib/tools/byacc"} $BYACC_FLAGS ${nopath;noext;output:SRC.cpp} ${input:SRC} ${nopath;noext;hide;output;addincl:SRC.h} ${kv;hide:"p YC"} ${kv;hide:"pc light-green"} .CMD=${tool:"contrib/tools/bison/bison"} $BISON_FLAGS --m4=${tool:"contrib/tools/bison/m4"} -d -o ${nopath;noext;output;main;hide:SRC.h} ${nopath;noext;output:SRC.cpp} ${input:SRC} ${SRCFLAGS} && $YMAKE_PYTHON ${input:"build/scripts/preprocess.py"} $_ADD_HIDDEN_INPUTS($CPP_BISON_SKELS) ${nopath;noext;output;addincl:SRC.h} ${kv;hide:"p YC"} ${kv;hide:"pc light-green"} -} - +} + # tag:src-processing -macro _SRC("ypp", SRC, SRCFLAGS...) { - .CMD=$_SRC(y $SRC $SRCFLAGS) -} - +macro _SRC("ypp", SRC, SRCFLAGS...) { + .CMD=$_SRC(y $SRC $SRCFLAGS) +} + # tag:src-processing -macro _SRC("gperf", SRC, SRCFLAGS...) { +macro _SRC("gperf", SRC, SRCFLAGS...) { .CMD=$RUN_NO_SANITIZE ${tool:"contrib/tools/gperf"} $GP_FLAGS ${SRCFLAGS} ${pre=-Nin_;suf=_set;nopath;noallext:SRC} ${input:SRC} ${output;stdout;nopath;noext;defext=.gperf.cpp:SRC} ${kv;hide:"p GP"} ${kv;hide:"pc yellow"} -} - +} + # tag:src-processing -macro _SRC("rl", SRC, SRCFLAGS...) { +macro _SRC("rl", SRC, SRCFLAGS...) { .CMD=$RUN_NO_SANITIZE ${tool:"contrib/tools/ragel5/ragel"} $RAGEL_FLAGS ${SRCFLAGS} -o ${tmp:SRC.tmp} ${input:SRC} && $RUN_NO_SANITIZE ${tool:"contrib/tools/ragel5/rlgen-cd"} $RLGEN_FLAGS -o ${output;nopath;noext;defext=.rl5.cpp:SRC} ${tmp:SRC.tmp} ${kv;hide:"p R5"} ${kv;hide:"pc yellow"} -} - +} + # tag:src-processing -macro _SRC("rl5", SRC, SRCFLAGS...) { - .CMD=$_SRC(rl $SRC $SRCFLAGS) -} - +macro _SRC("rl5", SRC, SRCFLAGS...) { + .CMD=$_SRC(rl $SRC $SRCFLAGS) +} + # tag:src-processing -macro _SRC("asp", SRC, SRCFLAGS...) { - .CMD=$RUN_NO_SANITIZE ${tool:"tools/html2cpp"} ${input:SRC} ${output:SRC.cpp} ${kv;hide:"p HT"} ${kv;hide:"pc yellow"} -} - +macro _SRC("asp", SRC, SRCFLAGS...) { + .CMD=$RUN_NO_SANITIZE ${tool:"tools/html2cpp"} ${input:SRC} ${output:SRC.cpp} ${kv;hide:"p HT"} ${kv;hide:"pc yellow"} +} + # tag:src-processing -macro _SRC("rl6", SRC, SRCFLAGS...) { +macro _SRC("rl6", SRC, SRCFLAGS...) { .CMD=$RUN_NO_SANITIZE ${tool:"contrib/tools/ragel6"} $RAGEL6_FLAGS ${SRCFLAGS} -L -I${ARCADIA_ROOT} -o ${output;nopath;noext;defext=.rl6.cpp:SRC} ${input:SRC} ${kv;hide:"p R6"} ${kv;hide:"pc yellow"} .SEM=target_ragel_lexers PRIVATE ${input:SRC} ${output;hide;suf=.o:SRC} $RAGEL6_FLAGS ${SRCFLAGS} && set_global_flags RAGEL_FLAGS -L -I $S/ && conan_require ragel/6.10 && conan_import '"bin, ragel* -> ./bin"' && modules_required yandex_common.cmake -} - +} + # tag:src-processing -macro _SRC("l", SRC, SRCFLAGS...) { - .CMD=${tool:"contrib/tools/flex-old"} $LEX_FLAGS ${SRCFLAGS} -o${output:SRC.cpp} ${output_include;hide:"util/system/compiler.h"} ${input:SRC} ${kv;hide:"p LX"} ${kv;hide:"pc yellow"} - .ADDINCL=contrib/tools/flex-old -} - +macro _SRC("l", SRC, SRCFLAGS...) { + .CMD=${tool:"contrib/tools/flex-old"} $LEX_FLAGS ${SRCFLAGS} -o${output:SRC.cpp} ${output_include;hide:"util/system/compiler.h"} ${input:SRC} ${kv;hide:"p LX"} ${kv;hide:"pc yellow"} + .ADDINCL=contrib/tools/flex-old +} + # tag:src-processing -macro _SRC("lex", SRC, SRCFLAGS...) { - .CMD=$_SRC(l $SRC $SRCFLAGS) -} - +macro _SRC("lex", SRC, SRCFLAGS...) { + .CMD=$_SRC(l $SRC $SRCFLAGS) +} + # tag:src-processing -macro _SRC("lpp", SRC, SRCFLAGS...) { - .CMD=$_SRC(l $SRC $SRCFLAGS) -} - +macro _SRC("lpp", SRC, SRCFLAGS...) { + .CMD=$_SRC(l $SRC $SRCFLAGS) +} + # tag:src-processing -macro _SRC("pln", SRC, SRCFLAGS...) { +macro _SRC("pln", SRC, SRCFLAGS...) { .CMD=$FML_TOOL -b -o ${output;pre=pln.;nopath;noext:SRC.cpp} -f ${input:SRC} ${SRCFLAGS} ${kv;hide:"p FM"} ${kv;hide:"pc yellow"} -} - +} + # tag:src-processing -macro _SRC("xsyn", SRC, SRCFLAGS...) { +macro _SRC("xsyn", SRC, SRCFLAGS...) { .CMD=$YMAKE_PYTHON ${input:"library/cpp/xml/parslib/xsyn2ragel.py"} ${input:SRC} ${input:"library/cpp/xml/parslib/xmlpars.xh"} dontuse ${output;stdout:SRC.h.rl5} ${kv;hide:"p XN"} ${kv;hide:"pc yellow"} -} - +} + # tag:src-processing -macro _SRC("ev", SRC, SRCFLAGS...) { - .CMD=$EVLOG_CMD($SRC) -} - +macro _SRC("ev", SRC, SRCFLAGS...) { + .CMD=$EVLOG_CMD($SRC) +} + # tag:src-processing -macro _SRC("proto", SRC, SRCFLAGS...) { - .CMD=$PROTO_CMD($SRC) +macro _SRC("proto", SRC, SRCFLAGS...) { + .CMD=$PROTO_CMD($SRC) .SEM=$PROTO_CMD($SRC) -} - +} + # tag:src-processing -macro _SRC("gztproto", SRC, SRCFLAGS...) { +macro _SRC("gztproto", SRC, SRCFLAGS...) { # _PROTO__INCLUDE is before ARCADIA_ROOT in includes because in gazetteer we don't use builtins now and paths'canonization (resolving) depends on order of roots. - # descriptor.proto must be resolved as google/protobuf/descriptor.proto + # descriptor.proto must be resolved as google/protobuf/descriptor.proto .CMD=${tool:"dict/gazetteer/converter"} -I$PROTOBUF_PATH ${pre="-I":_PROTO__INCLUDE} -I$ARCADIA_ROOT ${SRCFLAGS} ${input:SRC} ${output;nopath;noext;norel:SRC.proto} ${kv;hide:"p GZ"} ${kv;hide:"pc yellow"} .PEERDIR=kernel/gazetteer/proto -} - +} + # tag:src-processing macro _SRC("cfgproto", SRC, SRCFLAGS...) { .CMD=$_CPP_CFGPROTO_CMD($SRC) } # tag:src-processing -macro _SRC("pyx", SRC, SRCFLAGS...) { +macro _SRC("pyx", SRC, SRCFLAGS...) { # Copy-paste from BUILDWITH_CYTHON .CMD=$RUN_CYTHON_SCRIPT $CYTHON_OPTIONS --cplus ${CYTHON_CPP_OUTPUT_INCLUDES} ${pre=-I:_CYTHON__INCLUDE} ${input:SRC} -o ${output;tobindir:SRC.cpp} $CYTHON_OUTPUT_INCLUDES ${SRCFLAGS} ${requirements;hide:PY_REQUIREMENTS} ${kv;hide:"p CY"} ${kv;hide:"pc yellow"} .ADDINCL=FOR cython contrib/tools/cython/Cython/Includes -} - +} + # tag:src-processing -macro _SRC("in", SRC, SRCFLAGS...) { +macro _SRC("in", SRC, SRCFLAGS...) { .CMD=$CONFIGURE_FILE(${SRC} ${nopath;noext:SRC}) -} - +} + # tag:src-processing -macro _SRC("sc", SRC, SRCFLAGS...) { +macro _SRC("sc", SRC, SRCFLAGS...) { .CMD=${tool:"tools/domschemec"} --in ${input:SRC} --out ${output;norel:SRC.h} ${output_include;hide:"util/generic/strbuf.h"} ${output_include;hide:"util/generic/string.h"} ${output_include;hide:"util/generic/vector.h"} ${output_include;hide:"util/string/cast.h"} ${SRCFLAGS} ${kv;hide:"p SC"} ${kv;hide:"pc yellow"} -} - +} + # tag:src-processing macro _SRC("ssqls", SRC, SRCFLAGS...) { .CMD=${tool:"metrika/core/tools/ssqls"} ${input;notransformbuilddir:SRC} -S $ARCADIA_ROOT -B $ARCADIA_BUILD_ROOT $SRCFLAGS ${output;noext;hide:SRC.cpp} ${output;noext;hide:SRC.h} ${kv;hide:"p SS"} ${kv;hide:"pc yellow"} } # tag:src-processing -macro _SRC("f", SRC, SRCFLAGS...) { +macro _SRC("f", SRC, SRCFLAGS...) { .CMD=$YMAKE_PYTHON ${input:"build/scripts/f2c.py"} -t ${tool:"contrib/tools/f2c"} -c ${input:SRC} -o ${output:SRC.c} ${requirements;hide:CC_REQUIREMENTS} ${kv;hide:"p FT"} ${kv;hide:"pc light-green"} - .PEERDIR=contrib/libs/libf2c - .ADDINCL=contrib/libs/libf2c -} - + .PEERDIR=contrib/libs/libf2c + .ADDINCL=contrib/libs/libf2c +} + # tag:src-processing -macro _SRC("cpp", SRC, SRCFLAGS...) { - .CMD=$_SRC_cpp($SRC $SRCFLAGS) +macro _SRC("cpp", SRC, SRCFLAGS...) { + .CMD=$_SRC_cpp($SRC $SRCFLAGS) .SEM=target_sources PRIVATE ${input:SRC} ${output;hide;suf=.o:SRC} -} - +} + # tag:src-processing -macro _SRC("cxx", SRC, SRCFLAGS...) { - .CMD=$_SRC(cpp $SRC $SRCFLAGS) -} - +macro _SRC("cxx", SRC, SRCFLAGS...) { + .CMD=$_SRC(cpp $SRC $SRCFLAGS) +} + # tag:src-processing -macro _SRC("cc", SRC, SRCFLAGS...) { - .CMD=$_SRC(cpp $SRC $SRCFLAGS) +macro _SRC("cc", SRC, SRCFLAGS...) { + .CMD=$_SRC(cpp $SRC $SRCFLAGS) .SEM=target_sources PRIVATE ${input:SRC} ${output;hide;suf=.o:SRC} -} - +} + # tag:src-processing -macro _SRC("C", SRC, SRCFLAGS...) { - .CMD=$_SRC(cpp $SRC $SRCFLAGS) -} - +macro _SRC("C", SRC, SRCFLAGS...) { + .CMD=$_SRC(cpp $SRC $SRCFLAGS) +} + # tag:src-processing -macro _SRC("c", SRC, SRCFLAGS...) { - .CMD=$_SRC_c($SRC $SRCFLAGS) +macro _SRC("c", SRC, SRCFLAGS...) { + .CMD=$_SRC_c($SRC $SRCFLAGS) .SEM=target_sources PRIVATE ${input:SRC} ${output;hide;suf=.o:SRC} -} - +} + # tag:src-processing -macro _SRC("m", SRC, SRCFLAGS...) { - .CMD=$_SRC(c $SRC $SRCFLAGS) -} - +macro _SRC("m", SRC, SRCFLAGS...) { + .CMD=$_SRC(c $SRC $SRCFLAGS) +} + # tag:src-processing -macro _SRC("masm", SRC, SRCFLAGS...) { - .CMD=$_SRC_masm($SRC $SRCFLAGS) -} - +macro _SRC("masm", SRC, SRCFLAGS...) { + .CMD=$_SRC_masm($SRC $SRCFLAGS) +} + # tag:src-processing -macro _SRC("yasm", SRC, SRCFLAGS...) { - .CMD=$_SRC_yasm($SRC $SRCFLAGS PREINCLUDES $YASM_PREINCLUDES_VALUE) +macro _SRC("yasm", SRC, SRCFLAGS...) { + .CMD=$_SRC_yasm($SRC $SRCFLAGS PREINCLUDES $YASM_PREINCLUDES_VALUE) .SEM=target_yasm_source PRIVATE ${input:SRC} ${output;hide;suf=.o:SRC} $YASM_FLAGS ${pre=-I :_ASM__INCLUDE} $SRCFLAGS ${pre=-P :PREINCLUDES} && set_global_flags YASM_FLAGS -f ${_YASM_FMT_VALUE}${HARDWARE_ARCH} $_YASM_PLATFORM_FLAGS_VALUE -D ${pre=_;suf=_:HARDWARE_TYPE} -D_YASM_ $ASM_PREFIX_VALUE $_YASM_PREDEFINED_FLAGS_VALUE && conan_require yasm/1.3.0 && conan_import '"bin, *yasm* -> ./bin"' && conan_import '"bin, ytasm* -> ./bin"' && modules_required yandex_common.cmake -} - +} + # tag:src-processing macro _SRC("asm", SRC, SRCFLAGS...) { .CMD=$_SRC(yasm $SRC $SRCFLAGS) @@ -5952,49 +5952,49 @@ macro _SRC("lua", SRC, SRCFLAGS...) { } # tag:src-processing -macro _SRC("cu", SRC, SRCFLAGS...) { - .CMD=$_SRC_CU_CMD - .PEERDIR=$_SRC_CU_PEERDIR -} - +macro _SRC("cu", SRC, SRCFLAGS...) { + .CMD=$_SRC_CU_CMD + .PEERDIR=$_SRC_CU_PEERDIR +} + # tag:src-processing -macro _SRC("fbs", SRC, SRCFLAGS...) { - .CMD=$FBS_CMD($SRC, $SRCFLAGS) -} - +macro _SRC("fbs", SRC, SRCFLAGS...) { + .CMD=$FBS_CMD($SRC, $SRCFLAGS) +} + # tag:src-processing -macro _SRC("fbs64", SRC, SRCFLAGS...) { - .CMD=$_CPP_FLATC64_CMD($SRC, $SRCFLAGS) -} - +macro _SRC("fbs64", SRC, SRCFLAGS...) { + .CMD=$_CPP_FLATC64_CMD($SRC, $SRCFLAGS) +} + # tag:src-processing -macro _SRC("pysrc", SRC, SRCFLAGS...) { - .CMD=$_SRC_PYSRC($SRC, $SRCFLAGS) -} +macro _SRC("pysrc", SRC, SRCFLAGS...) { + .CMD=$_SRC_PYSRC($SRC, $SRCFLAGS) +} # tag:src-processing -macro _SRC_py2src(SRC, SRCFLAGS...) { - .CMD=${cwd:BINDIR} $YMAKE_PYTHON ${input:"build/scripts/compile_pysrc.py"} --input ${input:SRC} --output ${output;noext;suf=.py2_raw.cpp:SRC} --rescompiler ${tool:"tools/rescompiler"} py2 --python $(PYTHON)/python --py_compile ${input:"build/scripts/py_compile.py"} ${kv;hide:"p P2"} ${kv;hide:"pc light-green"} -} - +macro _SRC_py2src(SRC, SRCFLAGS...) { + .CMD=${cwd:BINDIR} $YMAKE_PYTHON ${input:"build/scripts/compile_pysrc.py"} --input ${input:SRC} --output ${output;noext;suf=.py2_raw.cpp:SRC} --rescompiler ${tool:"tools/rescompiler"} py2 --python $(PYTHON)/python --py_compile ${input:"build/scripts/py_compile.py"} ${kv;hide:"p P2"} ${kv;hide:"pc light-green"} +} + # tag:src-processing -macro _SRC_py3src(SRC, SRCFLAGS...) { - .CMD=${cwd:BINDIR} $YMAKE_PYTHON ${input:"build/scripts/compile_pysrc.py"} --input ${input:SRC} --output ${output;noext;suf=.py3_raw.cpp:SRC} --rescompiler ${tool:"tools/rescompiler"} py3 --pycc ${tool:"contrib/tools/python3/pycc"} ${kv;hide:"p P3"} ${kv;hide:"pc light-green"} -} - +macro _SRC_py3src(SRC, SRCFLAGS...) { + .CMD=${cwd:BINDIR} $YMAKE_PYTHON ${input:"build/scripts/compile_pysrc.py"} --input ${input:SRC} --output ${output;noext;suf=.py3_raw.cpp:SRC} --rescompiler ${tool:"tools/rescompiler"} py3 --pycc ${tool:"contrib/tools/python3/pycc"} ${kv;hide:"p P3"} ${kv;hide:"pc light-green"} +} + # tag:src-processing python-specific -when ($PYTHON3 == "yes") { - MACRO_ALIAS(_SRC_PYSRC _SRC_py3src) -} -otherwise { - MACRO_ALIAS(_SRC_PYSRC _SRC_py2src) -} - +when ($PYTHON3 == "yes") { + MACRO_ALIAS(_SRC_PYSRC _SRC_py3src) +} +otherwise { + MACRO_ALIAS(_SRC_PYSRC _SRC_py2src) +} + # tag:src-processing -macro _SRC_c_nodeps(SRC, OUTFILE, INC...) { - .CMD=$_SRC_C_NODEPS_CMD -} - +macro _SRC_c_nodeps(SRC, OUTFILE, INC...) { + .CMD=$_SRC_C_NODEPS_CMD +} + # Custom flags for generated cpp-files. To support another generator: # - insert additional file extension before .cpp into generated cpp-file name # - update _LANG_CFLAGS_FILTER variable. Don't forget to add ' SKIP ' after flag list @@ -6025,31 +6025,31 @@ macro _LANG_CFLAGS(SRC) { # tag:src-processing # ymake bug workaround: variables followed a macros call in .CMD are not substituted and are placed in result as is # Pack macro call into a variable and use it in _SRC_CPP_CMD instead of macro call -_LANG_CFLAGS_VALUE= -when ($CLANG == "yes" || $GCC == "yes") { - _LANG_CFLAGS_VALUE=$_LANG_CFLAGS(${noext:SRC}) -} +_LANG_CFLAGS_VALUE= +when ($CLANG == "yes" || $GCC == "yes") { + _LANG_CFLAGS_VALUE=$_LANG_CFLAGS(${noext:SRC}) +} # tag:src-processing macro _SRC_cpp(SRC, COMPILE_OUT_SUFFIX="", SRCFLAGS...) { - .CMD=$_SRC_CPP_CMD -} - + .CMD=$_SRC_CPP_CMD +} + # tag:src-processing macro _SRC_c(SRC, COMPILE_OUT_SUFFIX="", SRCFLAGS...) { - .CMD=$_SRC_C_CMD -} - + .CMD=$_SRC_C_CMD +} + # tag:src-processing -macro _SRC_m(SRC, SRCFLAGS...) { - .CMD=$_SRC_M_CMD -} - +macro _SRC_m(SRC, SRCFLAGS...) { + .CMD=$_SRC_M_CMD +} + # tag:src-processing -macro _SRC_masm(SRC, SRCFLAGS...) { - .CMD=$_SRC_MASM_CMD -} - +macro _SRC_masm(SRC, SRCFLAGS...) { + .CMD=$_SRC_MASM_CMD +} + # tag:lua-specific ### @usage: COMPILE_LUA(Src, [NAME <import_name>]) ### @@ -6060,21 +6060,21 @@ macro COMPILE_LUA(Src, NAME="") { } # tag:lua-specific -### @usage: _SRC_lua_21(SRC [SRCFLAGS...]) # internal -### -### Compile LUA source file to object code using LUA 2.1 -macro _SRC_lua_21(SRC, SRCFLAGS...) { - .CMD=${cwd:LUAJIT_21_PATH} ${tool:"contrib/libs/luajit_21/compiler"} -b -g ${input:SRC} ${SRCFLAGS} ${global;output;suf=.o:SRC} ${kv;hide:"p LJ"} ${kv;hide:"pc light-cyan"} - .PEERDIR=$LUAJIT_21_PATH -} - +### @usage: _SRC_lua_21(SRC [SRCFLAGS...]) # internal +### +### Compile LUA source file to object code using LUA 2.1 +macro _SRC_lua_21(SRC, SRCFLAGS...) { + .CMD=${cwd:LUAJIT_21_PATH} ${tool:"contrib/libs/luajit_21/compiler"} -b -g ${input:SRC} ${SRCFLAGS} ${global;output;suf=.o:SRC} ${kv;hide:"p LJ"} ${kv;hide:"pc light-cyan"} + .PEERDIR=$LUAJIT_21_PATH +} + # tag:lua-specific ### @usage: COMPILE_LUA_21(Src, [NAME <import_name>]) ### -### Compile LUA source file to object code using LUA 2.1 +### Compile LUA source file to object code using LUA 2.1 ### Optionally override import name which is by default reflects Src name macro COMPILE_LUA_21(Src, NAME="") { - .CMD=$_SRC_lua_21($Src, ${pre=-n :NAME}) + .CMD=$_SRC_lua_21($Src, ${pre=-n :NAME}) } GETTEXT_KEEP_PATH=no @@ -6087,7 +6087,7 @@ otherwise { } # tag:src-processing -macro _SRC("po", SRC, SRCFLAGS...) { +macro _SRC("po", SRC, SRCFLAGS...) { .CMD=$YMAKE_PYTHON ${input:"contrib/tools/python/src/Tools/i18n/msgfmt.py"} -o $_MO_OUTPUT ${input:SRC} } @@ -6139,10 +6139,10 @@ macro YDL_DESC_USE_BINARY() { ### ### Compile single file with extra Flags. ### Compilation is driven by the last extension of the File and Flags are specific to corresponding compilation command -macro SRC(FILE, FLAGS...) { - _SRC(${lastext:FILE} $FILE $FLAGS) -} - +macro SRC(FILE, FLAGS...) { + _SRC(${lastext:FILE} $FILE $FLAGS) +} + ### @usage: SRCS(<[GLOBAL] File> ...) ### ### Source files of the project. Files are built according to their extension and put int module output or fed to ultimate PROGRAM/DLL depending on GLOBAL presence. @@ -6158,40 +6158,40 @@ macro SRC(FILE, FLAGS...) { ### END() ### ### This will produce foo.o and feed it to any PROGRAM/DLL module transitively depending on test_global library. The library itself will be empty and won't produce .a file. -macro SRCS(FILES...) { - foreach (FILE : $FILES) { - _SRC(${lastext:FILE} $FILE) +macro SRCS(FILES...) { + foreach (FILE : $FILES) { + _SRC(${lastext:FILE} $FILE) } } # tag:cpu tag:src-processing ### @usage SRC_C_SSE2(File Flags...) ### Compile single .c-file with SSE2 and extra Flags. -macro SRC_C_SSE2(FILE, FLAGS...) { +macro SRC_C_SSE2(FILE, FLAGS...) { _SRC(c $FILE $SSE2_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .sse2) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_C_SSE3(File Flags...) ### Compile single .c-file with SSE3 and extra Flags. -macro SRC_C_SSE3(FILE, FLAGS...) { +macro SRC_C_SSE3(FILE, FLAGS...) { _SRC(c $FILE $SSE3_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .sse3) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_C_SSSE3(File Flags...) ### Compile single .c-file with SSSE3 and extra Flags. -macro SRC_C_SSSE3(FILE, FLAGS...) { +macro SRC_C_SSSE3(FILE, FLAGS...) { _SRC(c $FILE $SSSE3_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .ssse3) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_C_SSE41(File Flags...) ### Compile single .c-file with SSE4.1 and extra Flags. -macro SRC_C_SSE41(FILE, FLAGS...) { +macro SRC_C_SSE41(FILE, FLAGS...) { _SRC(c $FILE $SSE41_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .sse41) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_C_SSE4(File Flags...) ### Compile single .c-file with SSE4 (SSE4.1, SSE4.2 and POPCNT) and extra Flags. @@ -6202,17 +6202,17 @@ macro SRC_C_SSE4(FILE, FLAGS...) { # tag:cpu tag:src-processing ### @usage SRC_C_AVX(File Flags...) ### Compile single .c-file with AVX and extra Flags. -macro SRC_C_AVX(FILE, FLAGS...) { +macro SRC_C_AVX(FILE, FLAGS...) { _SRC(c $FILE $AVX_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .avx) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_C_AVX2(File Flags...) ### Compile single .c-file with AVX2 and extra Flags. -macro SRC_C_AVX2(FILE, FLAGS...) { +macro SRC_C_AVX2(FILE, FLAGS...) { _SRC(c $FILE $AVX2_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .avx2) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_CPP_PIC(File Flags...) ### Compile single .c-file with -fPIC and extra Flags. @@ -6223,31 +6223,31 @@ macro SRC_CPP_PIC(FILE, FLAGS...) { # tag:cpu tag:src-processing ### @usage SRC_CPP_SSE2(File Flags...) ### Compile single .cpp-file with SSE2 and extra Flags. -macro SRC_CPP_SSE2(FILE, FLAGS...) { +macro SRC_CPP_SSE2(FILE, FLAGS...) { _SRC(cpp $FILE $SSE2_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .sse2) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_CPP_SSE3(File Flags...) ### Compile single .cpp-file with SSE3 and extra Flags. -macro SRC_CPP_SSE3(FILE, FLAGS...) { +macro SRC_CPP_SSE3(FILE, FLAGS...) { _SRC(cpp $FILE $SSE3_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .sse3) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_CPP_SSSE3(File Flags...) ### Compile single .cpp-file with SSSE3 and extra Flags. -macro SRC_CPP_SSSE3(FILE, FLAGS...) { +macro SRC_CPP_SSSE3(FILE, FLAGS...) { _SRC(cpp $FILE $SSSE3_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .sss3) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_CPP_SSE41(File Flags...) ### Compile single .cpp-file with SSE4.1 and extra Flags. -macro SRC_CPP_SSE41(FILE, FLAGS...) { +macro SRC_CPP_SSE41(FILE, FLAGS...) { _SRC(cpp $FILE $SSE41_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .sse41) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_CPP_SSE4(File Flags...) ### Compile single .cpp-file with SSE4 (SSE4.1, SSE4.2 and POPCNT) and extra Flags. @@ -6258,23 +6258,23 @@ macro SRC_CPP_SSE4(FILE, FLAGS...) { # tag:cpu tag:src-processing ### @usage SRC_CPP_AVX(File Flags...) ### Compile single .cpp-file with AVX and extra Flags. -macro SRC_CPP_AVX(FILE, FLAGS...) { +macro SRC_CPP_AVX(FILE, FLAGS...) { _SRC(cpp $FILE $AVX_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .avx) -} - +} + # tag:cpu tag:src-processing ### @usage SRC_CPP_AVX2(File Flags...) ### Compile single .cpp-file with AVX2 and extra Flags. -macro SRC_CPP_AVX2(FILE, FLAGS...) { +macro SRC_CPP_AVX2(FILE, FLAGS...) { _SRC(cpp $FILE $AVX2_CFLAGS $FLAGS COMPILE_OUT_SUFFIX .avx2) -} - +} + # tag:python-processing tag:cython # TODO: use it in [.pyx] cmd ### @usage: BUILDWITH_CYTHON_CPP(Src Options...) ### ### Generates .cpp file from .pyx. -macro BUILDWITH_CYTHON_CPP(Src, Options...) { +macro BUILDWITH_CYTHON_CPP(Src, Options...) { .CMD=$RUN_CYTHON_SCRIPT $CYTHON_OPTIONS ${Options} --cplus ${CYTHON_CPP_OUTPUT_INCLUDES} ${pre=-I:_CYTHON__INCLUDE} ${input:Src} -o ${output;tobindir:Src.cpp} $CYTHON_OUTPUT_INCLUDES ${requirements;hide:PY_REQUIREMENTS} ${kv;hide:"p CY"} ${kv;hide:"pc yellow"} ADDINCL(FOR cython contrib/tools/cython/Cython/Includes) } @@ -6293,7 +6293,7 @@ macro _BUILDWITH_CYTHON_CPP_DEP(Src, Dep, Options...) { ### @usage: BUILDWITH_CYTHON_C(Src Options...) ### ### Generates .c file from .pyx. -macro BUILDWITH_CYTHON_C(Src, Options...) { +macro BUILDWITH_CYTHON_C(Src, Options...) { .CMD=$RUN_CYTHON_SCRIPT $CYTHON_OPTIONS ${Options} ${pre=-I:_CYTHON__INCLUDE} ${input:Src} -o ${output;tobindir:Src.c} $CYTHON_OUTPUT_INCLUDES ${requirements;hide:PY_REQUIREMENTS} ${kv;hide:"p CY"} ${kv;hide:"pc yellow"} ADDINCL(FOR cython contrib/tools/cython/Cython/Includes) } @@ -6348,9 +6348,9 @@ macro _SWIG_PYTHON_C(Src, DstSubPrefix) { ### @usage: BUILDWITH_RAGEL6(Src Options...) ### ### Compile .rl file using Ragel6. -macro BUILDWITH_RAGEL6(Src, Options...) { +macro BUILDWITH_RAGEL6(Src, Options...) { .CMD=$RUN_NO_SANITIZE ${tool:"contrib/tools/ragel6"} $RAGEL6_FLAGS ${Options} -I${ARCADIA_ROOT} -o ${output;nopath;noext;defext=.rl6.cpp:Src} ${input:Src} ${kv;hide:"p R6"} ${kv;hide:"pc yellow"} -} +} # tag:python-processing tag:internal # TODO: use it in [.pyx] cmd @@ -6359,9 +6359,9 @@ macro BUILDWITH_RAGEL6(Src, Options...) { ### Register Python 2.x module in internal resource file system. Arcadia Python 2.x importer will be retrieve these on import directive. ### ### Documentation: https://wiki.yandex-team.ru/devtools/commandsandvars/pysrcs/#makrospyregister -macro _PY_REGISTER(Func) { +macro _PY_REGISTER(Func) { .CMD=$YMAKE_PYTHON ${input:"build/scripts/gen_py_reg.py"} $Func ${output;noauto:Func.reg.cpp} ${requirements;hide:PY_REQUIREMENTS} ${kv;hide:"p PY"} ${kv;hide:"pc yellow"} - SRCS(GLOBAL $Func.reg.cpp) + SRCS(GLOBAL $Func.reg.cpp) } # tag:python-processing tag:internal @@ -6383,7 +6383,7 @@ macro _PY3_REGISTER(Func) { ### Documentation: https://wiki.yandex-team.ru/devtools/commandsandvars/pysrcs/#makrospyregister macro _PY_COMPILE_BYTECODE(SrcX, Src, Dst) { .CMD=$YMAKE_PYTHON ${input:"build/scripts/py_compile.py"} $SrcX ${input:Src} ${output;noauto:Dst.yapyc} ${requirements;hide:PY_REQUIREMENTS} ${kv;hide:"p PY"} ${kv;hide:"pc yellow"} -} +} # tag:python-processing tag:internal ### @usage: _PY3_COMPILE_BYTECODE(SrcX Src) # internal @@ -6405,15 +6405,15 @@ macro ARCHIVE_ASM(NAME="", DONTCOMPRESS?"-p":"", REQUIREMENTS[], Files...) { } # tag:yweb-specific -macro PIRE_INLINE_CMD(SRC) { +macro PIRE_INLINE_CMD(SRC) { .CMD=${tool:"library/cpp/regex/pire/inline"} -o ${output:SRC} ${input:SRC} ${output_include;hide:SRC} ${kv;hide:"p PI"} ${kv;hide:"pc yellow"} } # tag:yweb-specific -macro PIRE_INLINE(FILES...) { - foreach (FILE : $FILES) { - PIRE_INLINE_CMD($FILE) - } +macro PIRE_INLINE(FILES...) { + foreach (FILE : $FILES) { + PIRE_INLINE_CMD($FILE) + } } ### @usage: ARCHIVE(archive_name [DONT_COMPRESS] files...) @@ -6433,8 +6433,8 @@ macro ARCHIVE(NAME="", DONTCOMPRESS?"-p":"", REQUIREMENTS[], Files...) { ### Example: https://wiki.yandex-team.ru/yatool/howtowriteyamakefiles/#a1ispolzujjtekomanduarchive macro ARCHIVE_BY_KEYS(NAME="", KEYS="", DONTCOMPRESS?"-p":"", REQUIREMENTS[], Files...) { .CMD=$ARCH_TOOL -q -x $DONTCOMPRESS ${input:Files} -k $KEYS -o ${output;chksum;addincl;noauto:NAME} ${requirements;hide:REQUIREMENTS} ${kv;hide:"p AR"} ${kv;hide:"pc light-red"} -} - +} + #scripts #special commands @@ -6468,10 +6468,10 @@ macro UPDATE_VCS_JAVA_INFO_NODEP(Jar) { ### ### Creates header file to access some information about build specified via configuration variables. ### Unlike CREATE_SVNVERSION_FOR() it doesn't take revion information from VCS, it uses revision and SandboxTaskId passed via -D options to ya make -macro CREATE_BUILDINFO_FOR(GenHdr) { +macro CREATE_BUILDINFO_FOR(GenHdr) { .CMD=$YIELD $CXX_COMPILER && $YIELD $CXXFLAGS && $XARGS $YMAKE_PYTHON ${input:BUILDVERSION_SCRIPT} ${output:GenHdr} ${kv;hide:"p BI"} ${kv;hide:"pc yellow"} ${hide;kv:"show_out"} $SVN_DEPENDS_CACHE__NO_UID__ -} - +} + DECIMAL_MD5_SCRIPT=build/scripts/decimal_md5.py DECIMAL_MD5_FIXED= @@ -6496,16 +6496,16 @@ macro CFG_VARS() { ### Copy file with the replacement of configuration variables in form of @ANY_CONF_VAR@ with their values. ### The values are collected during configure stage, while replacement itself happens during build stage. ### Used implicitly for .in-files processing. -macro CONFIGURE_FILE(Src, Dst) { - .CMD=$YMAKE_PYTHON ${input:"build/scripts/configure_file.py"} ${input:Src} ${output;addincl:Dst} $CFG_VARS ${kv;hide:"p CF"} ${kv;hide:"pc yellow"} +macro CONFIGURE_FILE(Src, Dst) { + .CMD=$YMAKE_PYTHON ${input:"build/scripts/configure_file.py"} ${input:Src} ${output;addincl:Dst} $CFG_VARS ${kv;hide:"p CF"} ${kv;hide:"pc yellow"} .SEM=set_vasrs ${CFG_VARS} && configure_file $S/${input;rootrel:Src} $B/${output;rootrel:Dst} } ### @usage: BASE_CODEGEN(tool_path prefix) ### ### Generator ${prefix}.cpp + ${prefix}.h files based on ${prefix}.in. -macro BASE_CODEGEN(Tool, Prefix, Opts...) { - .CMD=${tool:Tool} ${input:Prefix.in} ${output;nopath;noauto:Prefix.cpp} ${output;nopath:Prefix.h} $Opts ${kv;hide:"p BC"} ${kv;hide:"pc yellow"} +macro BASE_CODEGEN(Tool, Prefix, Opts...) { + .CMD=${tool:Tool} ${input:Prefix.in} ${output;nopath;noauto:Prefix.cpp} ${output;nopath:Prefix.h} $Opts ${kv;hide:"p BC"} ${kv;hide:"pc yellow"} } # tag:internal @@ -6514,7 +6514,7 @@ macro BASE_CODEGEN(Tool, Prefix, Opts...) { ### Generator of a certain number .the. cpp file + one header .h file from .in. ### This is the call of the generator. Python macro SPLIT_CODEGEN() is defined in order to properly fill command outputs from OUT_NUM argument. macro _SPLIT_CODEGEN_BASE(Tool, Prefix, OUT[], OPTS[], OUTPUT_INCLUDES[]) { - .CMD=${tool:Tool} ${input:Prefix.in} ${output;hide:OUT} ${output;nopath;noauto:Prefix.cpp} ${output;nopath:Prefix.h} $OPTS ${output_include;hide:OUTPUT_INCLUDES} ${kv;hide:"p SC"} ${kv;hide:"pc yellow"} + .CMD=${tool:Tool} ${input:Prefix.in} ${output;hide:OUT} ${output;nopath;noauto:Prefix.cpp} ${output;nopath:Prefix.h} $OPTS ${output_include;hide:OUTPUT_INCLUDES} ${kv;hide:"p SC"} ${kv;hide:"pc yellow"} } STRUCT_CODEGEN_OUTPUT_INCLUDES=${output_include;hide:"util/generic/singleton.h"} \ @@ -6527,15 +6527,15 @@ ${output_include;hide:"kernel/struct_codegen/reflection/floats.h"} ### @usage: STRUCT_CODEGEN(Prefix) ### A special case BASE_CODEGEN, in which the kernel/struct_codegen/codegen_tool tool is used. -macro STRUCT_CODEGEN(Prefix) { +macro STRUCT_CODEGEN(Prefix) { .CMD=$BASE_CODEGEN(kernel/struct_codegen/codegen_tool, $Prefix, $STRUCT_CODEGEN_OUTPUT_INCLUDES) - .PEERDIR=kernel/struct_codegen/metadata kernel/struct_codegen/reflection -} + .PEERDIR=kernel/struct_codegen/metadata kernel/struct_codegen/reflection +} ### @usage: DUMPERF_CODEGEN(Prefix) ### A special case BASE_CODEGEN, in which the extsearch/images/robot/tools/dumperf/codegen tool is used -macro DUMPERF_CODEGEN(Prefix) { - .CMD=$BASE_CODEGEN(extsearch/images/robot/tools/dumperf/codegen, $Prefix, ${output_include;hide:"extsearch/images/kernel/erf/erf_format.h"}) +macro DUMPERF_CODEGEN(Prefix) { + .CMD=$BASE_CODEGEN(extsearch/images/robot/tools/dumperf/codegen, $Prefix, ${output_include;hide:"extsearch/images/kernel/erf/erf_format.h"}) } # tag:flags @@ -6543,48 +6543,48 @@ macro DUMPERF_CODEGEN(Prefix) { ### ### Add flags to the link command line of executable or shared library/dll. ### Note: LDFLAGS are always global. When set in the LIBRARY module they will affect all programs/dlls/tests the library is linked into. -### Note: remember about the incompatibility of flags for gcc and cl. -macro LDFLAGS(Flags...) { - SET_APPEND(LDFLAGS_GLOBAL $Flags) -} - +### Note: remember about the incompatibility of flags for gcc and cl. +macro LDFLAGS(Flags...) { + SET_APPEND(LDFLAGS_GLOBAL $Flags) +} + # tag:flags ### @usage: CFLAGS([GLOBAL compiler_flag]* compiler_flags) ### ### Add the specified flags to the compilation command of C and C++ files. ### @params: GLOBAL - Propagates these flags to dependent projects ### Note: remember about the incompatibility flags for clang and cl (to set flags specifically for cl.exe use MSVC_FLAGS). -macro CFLAGS(Flags...) { - SET_APPEND_WITH_GLOBAL(USER_CFLAGS $Flags) +macro CFLAGS(Flags...) { + SET_APPEND_WITH_GLOBAL(USER_CFLAGS $Flags) } # tag:flags ### @usage: MASMFLAGS(compiler flags) ### Add the specified flags to the compilation command of .masm files. -macro MASMFLAGS(Flags...) { - SET_APPEND(MASMFLAGS $Flags) +macro MASMFLAGS(Flags...) { + SET_APPEND(MASMFLAGS $Flags) } # tag:flags ### @usage: CONLYFLAGS([GLOBAL compiler_flag]* compiler_flags) ### Add the specified flags to the compilation command of .c (but not .cpp) files. ### @params: GLOBAL - Distributes these flags on dependent projects -macro CONLYFLAGS(Flags...) { - SET_APPEND_WITH_GLOBAL(USER_CONLYFLAGS $Flags) +macro CONLYFLAGS(Flags...) { + SET_APPEND_WITH_GLOBAL(USER_CONLYFLAGS $Flags) } # tag:flags ### @usage: CXXFLAGS(compiler_flags) ### Add the specified flags to the compilation command of .cpp (but not .c) files. -macro CXXFLAGS(Flags...) { - SET_APPEND_WITH_GLOBAL(USER_CXXFLAGS $Flags) +macro CXXFLAGS(Flags...) { + SET_APPEND_WITH_GLOBAL(USER_CXXFLAGS $Flags) } # tag:flags ### @usage: CUDA_NVCC_FLAGS(compiler flags) ### Add the specified flags to the compile line .cu-files. -macro CUDA_NVCC_FLAGS(Flags...) { - SET_APPEND(CUDA_NVCC_FLAGS $Flags) +macro CUDA_NVCC_FLAGS(Flags...) { + SET_APPEND(CUDA_NVCC_FLAGS $Flags) } # tag:flags @@ -6599,42 +6599,42 @@ macro NVCC_DEVICE_LINK(Srcs...) { ### @usage: STRIP() ### Strip debug info from a PROGRAM, DLL or TEST. ### This macro doesn't work in LIBRARY's, UNION's and PACKAGE's. -macro STRIP() { - ENABLE(STRIP) +macro STRIP() { + ENABLE(STRIP) } ### @usage: NO_OPTIMIZE() ### Build code without any optimizations (-O0 mode). -macro NO_OPTIMIZE() { - ENABLE(NO_OPTIMIZE) +macro NO_OPTIMIZE() { + ENABLE(NO_OPTIMIZE) } ### @usage: NO_COMPILER_WARNINGS() ### Disable all compiler warnings in the module. ### Priorities: NO_COMPILER_WARNINGS > NO_WERROR > WERROR_MODE > WERROR. -macro NO_COMPILER_WARNINGS() { - ENABLE(NO_COMPILER_WARNINGS) -} - +macro NO_COMPILER_WARNINGS() { + ENABLE(NO_COMPILER_WARNINGS) +} + ### @usage: WERROR() ### Consider warnings as errors in the current module. ### In the bright future will be removed, since WERROR is the default. ### Priorities: NO_COMPILER_WARNINGS > NO_WERROR > WERROR_MODE > WERROR. -macro WERROR() { - ENABLE(WERROR) +macro WERROR() { + ENABLE(WERROR) } ### @usage: NO_WERROR() ### Override WERROR() behavior ### Priorities: NO_COMPILER_WARNINGS > NO_WERROR > WERROR_MODE > WERROR. -macro NO_WERROR() { - DISABLE(WERROR) +macro NO_WERROR() { + DISABLE(WERROR) } ### @usage: NO_WSHADOW() ### Disable C++ shadowing warnings. -macro NO_WSHADOW() { - ENABLE(NO_WSHADOW) +macro NO_WSHADOW() { + ENABLE(NO_WSHADOW) } # tag:internal @@ -6657,8 +6657,8 @@ macro NO_CODENAVIGATION() { ### Build module without dependency on util. ### Note: use this with care. Util most likely will be linked into executable anyway, ### so using util headers/functions/classes may not be detected at build time and may lead to unpredictable behavors at configure time. -macro NO_UTIL() { - ENABLE(NOUTIL) +macro NO_UTIL() { + ENABLE(NOUTIL) } ### @usage: NO_RUNTIME() @@ -6668,10 +6668,10 @@ macro NO_UTIL() { ### 2. If the project that contains the macro NO_RUNTIME(), peerdir-it project does not contain NO_RUNTIME() => Warning. ### Note: use this with care. Arcadia STL most likely will be linked into executable anyway, so using STL headers/functions/classes ### may not be detected at build time and may lead to unpredictable behavors at configure time. -macro NO_RUNTIME() { - SET(USE_ARCADIA_LIBM no) - NO_UTIL() - ENABLE(NORUNTIME) +macro NO_RUNTIME() { + SET(USE_ARCADIA_LIBM no) + NO_UTIL() + ENABLE(NORUNTIME) } ### @usage: NO_LIBC() @@ -6679,9 +6679,9 @@ macro NO_RUNTIME() { ### Exclude dependencies on C++ and C runtimes (including util, musl and libeatmydata). ### Note: use this with care. libc most likely will be linked into executable anyway, ### so using libc headers/functions may not be detected at build time and may lead to unpredictable behavors at configure time. -macro NO_LIBC() { - NO_RUNTIME() - DISABLE(MUSL) +macro NO_LIBC() { + NO_RUNTIME() + DISABLE(MUSL) } ### @usage: NO_PLATFORM() @@ -6695,27 +6695,27 @@ macro NO_PLATFORM() { } # tag:cpp-specific -### @usage: USE_CXX() -### -### Add dependency on C++ runtime -### Note: This macro is inteneded for use in _GO_BASE_UNIT like module when the module is built without C++ runtime by default -macro USE_CXX() { - DISABLE(NORUNTIME) -} - -### @usage: USE_UTIL() -### -### Add dependency on util and C++ runtime -### Note: This macro is intended for use in _GO_BASE_UNIT like module when the module is build without util by default -macro USE_UTIL() { - USE_CXX() - DISABLE(NOUTIL) -} - +### @usage: USE_CXX() +### +### Add dependency on C++ runtime +### Note: This macro is inteneded for use in _GO_BASE_UNIT like module when the module is built without C++ runtime by default +macro USE_CXX() { + DISABLE(NORUNTIME) +} + +### @usage: USE_UTIL() +### +### Add dependency on util and C++ runtime +### Note: This macro is intended for use in _GO_BASE_UNIT like module when the module is build without util by default +macro USE_UTIL() { + USE_CXX() + DISABLE(NOUTIL) +} + # tag:deprecated ### @usage: NO_JOIN_SRC() # deprecated, does-nothing ### This macro currently does nothing. This is default behavior which cannot be overridden at module level. -macro NO_JOIN_SRC() { +macro NO_JOIN_SRC() { ENABLE(UNUSED_MACRO) } @@ -6730,16 +6730,16 @@ macro JOINSRC() { ### @usage: NO_SANITIZE() ### ### Disable all sanitizers for the module. -macro NO_SANITIZE() { - DISABLE(SANITIZER_TYPE) +macro NO_SANITIZE() { + DISABLE(SANITIZER_TYPE) } # tag:coverage tag:sanitize ### @usage: NO_SANITIZE_COVERAGE() ### ### Disable lightweight coverage (-fsanitize-coverage) for the module. -macro NO_SANITIZE_COVERAGE() { - DISABLE(SANITIZE_COVERAGE) +macro NO_SANITIZE_COVERAGE() { + DISABLE(SANITIZE_COVERAGE) } # tag:coverage @@ -6773,20 +6773,20 @@ macro NO_CYTHON_COVERAGE() { } # tag:lua-specific -LUAJIT_PATH=${ARCADIA_ROOT}/contrib/libs/luajit +LUAJIT_PATH=${ARCADIA_ROOT}/contrib/libs/luajit macro _LUAJIT_OBJDUMP(Src, OUT="") { - .CMD=${cwd:LUAJIT_PATH} ${tool:"contrib/libs/luajit/compiler"} -b -g ${input:Src} ${output;noauto:OUT} ${kv;hide:"p LJ"} ${kv;hide:"pc light-cyan"} + .CMD=${cwd:LUAJIT_PATH} ${tool:"contrib/libs/luajit/compiler"} -b -g ${input:Src} ${output;noauto:OUT} ${kv;hide:"p LJ"} ${kv;hide:"pc light-cyan"} } # tag:lua-specific -LUAJIT_21_PATH=${ARCADIA_ROOT}/contrib/libs/luajit_21 +LUAJIT_21_PATH=${ARCADIA_ROOT}/contrib/libs/luajit_21 macro _LUAJIT_21_OBJDUMP(Src, OUT="") { .CMD=${cwd:LUAJIT_21_PATH} ${tool:"contrib/libs/luajit_21/compiler"} -b -g ${input:Src} ${output;noauto:OUT} ${kv;hide:"p LJ"} ${kv;hide:"pc light-cyan"} } macro _MX_BIN_TO_INFO(Src) { .CMD=${tool:"tools/mx_bin2info"} ${input:Src} ${output;nopath;noext;noauto:Src.info} ${kv;hide:"p MX"} ${kv;hide:"pc yellow"} -} +} MX_GEN_TABLE_INCLS=${output_include;hide:"yabs_mx_calc_table.h"} \ ${output_include;hide:"kernel/matrixnet/mn_sse.h"} \ @@ -6797,8 +6797,8 @@ ${output_include;hide:"util/generic/ptr.h"} \ ${output_include;hide:"util/generic/singleton.h"} macro _MX_GEN_TABLE(Srcs...) { - .CMD=$YMAKE_PYTHON ${input:"build/scripts/gen_mx_table.py"} $Srcs ${output;stdout:"mx_tables.cpp"} $MX_GEN_TABLE_INCLS ${kv;hide:"p MX"} ${kv;hide:"pc yellow"} - PEERDIR(kernel/matrixnet) + .CMD=$YMAKE_PYTHON ${input:"build/scripts/gen_mx_table.py"} $Srcs ${output;stdout:"mx_tables.cpp"} $MX_GEN_TABLE_INCLS ${kv;hide:"p MX"} ${kv;hide:"pc yellow"} + PEERDIR(kernel/matrixnet) PEERDIR(library/cpp/archive) } @@ -6809,8 +6809,8 @@ RELEV_FML_CODEGEN_INCLS=${output_include;hide:"kernel/relevfml/relev_fml.h"} ${o ### Create serialization support for enumeration members defined in the header (String <-> Enum conversions) and compile it into the module. ### ### Documentation: https://wiki.yandex-team.ru/yatool/HowToWriteYaMakeFiles/ -macro GENERATE_ENUM_SERIALIZATION(File) { - .CMD=$ENUM_PARSER_TOOL ${input:File} --include-path ${input;rootrel:File} --output ${output;chksum;suf=_serialized.cpp:File} ${output_include;hide:File} ${output_include;hide:"util/generic/serialized_enum.h"} ${kv;hide:"p EN"} ${kv;hide:"pc yellow"} +macro GENERATE_ENUM_SERIALIZATION(File) { + .CMD=$ENUM_PARSER_TOOL ${input:File} --include-path ${input;rootrel:File} --output ${output;chksum;suf=_serialized.cpp:File} ${output_include;hide:File} ${output_include;hide:"util/generic/serialized_enum.h"} ${kv;hide:"p EN"} ${kv;hide:"pc yellow"} .SEM=generate_enum_serilization ${input:File} ${output;hide;suf=_serialized.o:File} INCLUDE_HEADERS ${input;rootrel:File} ${tool;hide:"tools/enum_parser/enum_parser/bin"} PEERDIR(tools/enum_parser/enum_serialization_runtime) } @@ -6821,17 +6821,17 @@ macro GENERATE_ENUM_SERIALIZATION(File) { ### Provide access to serialization functions via generated header File_serialized.h ### ### Documentation: https://wiki.yandex-team.ru/yatool/HowToWriteYaMakeFiles/ -macro GENERATE_ENUM_SERIALIZATION_WITH_HEADER(File) { - .CMD=$ENUM_PARSER_TOOL ${input:File} --include-path ${input;rootrel:File} --output ${output;chksum;suf=_serialized.cpp:File} --header ${output;chksum;suf=_serialized.h:File} ${output_include;hide:File} ${kv;hide:"p EN"} ${kv;hide:"pc yellow"} +macro GENERATE_ENUM_SERIALIZATION_WITH_HEADER(File) { + .CMD=$ENUM_PARSER_TOOL ${input:File} --include-path ${input;rootrel:File} --output ${output;chksum;suf=_serialized.cpp:File} --header ${output;chksum;suf=_serialized.h:File} ${output_include;hide:File} ${kv;hide:"p EN"} ${kv;hide:"pc yellow"} .SEM=generate_enum_serilization ${input:File} ${output;hide;suf=_serialized.o:File} GEN_HEADER ${output;suf=_serialized.h:File} INCLUDE_HEADERS ${input;rootrel:File} ${tool;hide:"tools/enum_parser/enum_parser/bin"} PEERDIR(tools/enum_parser/enum_serialization_runtime) -} +} ### @usage: DEB_VERSION(File) ### ### Creates a header file DebianVersion.h define the DEBIAN_VERSION taken from the File. -macro DEB_VERSION(File) { - .CMD=$YMAKE_PYTHON ${input:"build/scripts/mkver.py"} ${input:File} ${output;stdout:"DebianVersion.h"} ${kv;hide:"p CL"} ${kv;hide:"pc yellow"} +macro DEB_VERSION(File) { + .CMD=$YMAKE_PYTHON ${input:"build/scripts/mkver.py"} ${input:File} ${output;stdout:"DebianVersion.h"} ${kv;hide:"p CL"} ${kv;hide:"pc yellow"} } BUILD_MN_SCRIPT=build/scripts/build_mn.py @@ -6841,14 +6841,14 @@ BUILD_MN_SCRIPT=build/scripts/build_mn.py ### ### Generate MatrixNet data and access code using single command. ### Alternative macro BUILD_MNS() works faster and better for large files. -macro BUILD_MN(MnInfo, MnName, CHECK?"fml_tool=$FML_UNUSED_TOOL CHECK":"", MULTI?, PTR?, RANKING_SUFFIX="") { - .CMD=$YMAKE_PYTHON ${input:BUILD_MN_SCRIPT} BuildMnF $ARCADIA_ROOT $ARCH_TOOL ${input:MnInfo} $MnName ranking_suffix=$RANKING_SUFFIX ${output;chksum;pre=mn.:MnName.cpp} ${output;hide;pre=MN_External_;suf=.rodata:MnName} ${output_include;hide:"kernel/matrixnet/mn_sse.h"} $CHECK $MULTI $PTR ${kv;hide:"p MN"} ${kv;hide:"pc yellow"} +macro BUILD_MN(MnInfo, MnName, CHECK?"fml_tool=$FML_UNUSED_TOOL CHECK":"", MULTI?, PTR?, RANKING_SUFFIX="") { + .CMD=$YMAKE_PYTHON ${input:BUILD_MN_SCRIPT} BuildMnF $ARCADIA_ROOT $ARCH_TOOL ${input:MnInfo} $MnName ranking_suffix=$RANKING_SUFFIX ${output;chksum;pre=mn.:MnName.cpp} ${output;hide;pre=MN_External_;suf=.rodata:MnName} ${output_include;hide:"kernel/matrixnet/mn_sse.h"} $CHECK $MULTI $PTR ${kv;hide:"p MN"} ${kv;hide:"pc yellow"} } macro _BUILD_MNS_FILE(Input, Name, Output, Suffix, Check, Fml_tool, AsmDataName) { - .CMD=$YMAKE_PYTHON ${input:BUILD_MN_SCRIPT} BuildMnsFilesF $ARCADIA_ROOT $BINDIR $ARCH_TOOL fml_tool=$Fml_tool $Name ranking_suffix=$Suffix ${input:Input} ${output;hide:Output} ${output;hide;pre=MN_External_;suf=.rodata:AsmDataName} ${output_include;hide:"kernel/matrixnet/mn_sse.h"} ${kv;hide:"p MN"} ${kv;hide:"pc yellow"} -} - + .CMD=$YMAKE_PYTHON ${input:BUILD_MN_SCRIPT} BuildMnsFilesF $ARCADIA_ROOT $BINDIR $ARCH_TOOL fml_tool=$Fml_tool $Name ranking_suffix=$Suffix ${input:Input} ${output;hide:Output} ${output;hide;pre=MN_External_;suf=.rodata:AsmDataName} ${output_include;hide:"kernel/matrixnet/mn_sse.h"} ${kv;hide:"p MN"} ${kv;hide:"pc yellow"} +} + MNS_OUTPUT=mnmodels macro _BUILD_MNS_CPP(NAME="", CHECK?, RANKING_SUFFIX="", Files...) { @@ -6856,7 +6856,7 @@ macro _BUILD_MNS_CPP(NAME="", CHECK?, RANKING_SUFFIX="", Files...) { } macro _BUILD_MNS_HEADER(NAME="", CHECK?, RANKING_SUFFIX="", Files...) { - .CMD=$YMAKE_PYTHON ${input:BUILD_MN_SCRIPT} BuildMnsHeaderF $NAME ranking_suffix=$RANKING_SUFFIX ${output:MNS_OUTPUT.h} ${input:Files} ${output_include;hide:"kernel/matrixnet/mn_sse.h"} ${output_include;hide:"kernel/matrixnet/mn_multi_categ.h"} ${kv;hide:"p MN"} ${kv;hide:"pc yellow"} + .CMD=$YMAKE_PYTHON ${input:BUILD_MN_SCRIPT} BuildMnsHeaderF $NAME ranking_suffix=$RANKING_SUFFIX ${output:MNS_OUTPUT.h} ${input:Files} ${output_include;hide:"kernel/matrixnet/mn_sse.h"} ${output_include;hide:"kernel/matrixnet/mn_multi_categ.h"} ${kv;hide:"p MN"} ${kv;hide:"pc yellow"} } # TODO: support foreach_in and keywords simultaneous usage (look at BUILD_MNS_FILES) @@ -6866,7 +6866,7 @@ macro _BUILD_MNS_HEADER(NAME="", CHECK?, RANKING_SUFFIX="", Files...) { ### ### Generate MatrixNet data and access code using separate commands for support code, interface and data. ### Faster version of BUILD_MN() macro for large files. -macro BUILD_MNS(Files...) { +macro BUILD_MNS(Files...) { _BUILD_MNS_HEADER($Files) _BUILD_MNS_CPP($Files) _BUILD_MNS_FILES($Files) @@ -6914,28 +6914,28 @@ macro NO_NEED_CHECK(Flags...) { ### Mark the project as needing review. ### Reviewers are listed in the macro OWNER. The use of this macro is disabled by default. ### Details can be found here: https://clubs.at.yandex-team.ru/arcadia/6104 -macro NEED_REVIEW(Flags...) { +macro NEED_REVIEW(Flags...) { # TODO: FIXME - ENABLE(UNUSED_MACRO) + ENABLE(UNUSED_MACRO) } ### @usage: VERSION(Args...) ### ### Specify version of a module. Currently unused by build system, only informative. -macro VERSION(Flags...) { - ENABLE(UNUSED_MACRO) +macro VERSION(Flags...) { + ENABLE(UNUSED_MACRO) } DATAWORK_SCHEEME_EXPORT_FLAGS= - -when ($UNIX == "yes") { - SCHEEME2_CFLAGS= -E -x c++ -} - -when ($WIN32 == "yes") { - SCHEEME2_CFLAGS= /E /TP -} - + +when ($UNIX == "yes") { + SCHEEME2_CFLAGS= -E -x c++ +} + +when ($WIN32 == "yes") { + SCHEEME2_CFLAGS= /E /TP +} + SCHEEME2_STRUCT_INFO_FLAGS=-f "const static ui32 RecordSig" -u "RecordSig" --gcc44_no_typename --no_complex_overloaded_func_export ### @usage: GEN_SCHEEME2(scheeme_name from_file dependent_files...) ### @@ -6959,15 +6959,15 @@ SCHEEME2_STRUCT_INFO_FLAGS=-f "const static ui32 RecordSig" -u "RecordSig" --gcc ### ### for compatibility with C++ compiler and the external environment. ### See tools/structparser for more details. -macro GEN_SCHEEME2(ScheemeName, FromFile) { +macro GEN_SCHEEME2(ScheemeName, FromFile) { .CMD=$CXX_COMPILER $C_FLAGS_PLATFORM -c ${tmp;stdout:FromFile.cph} $SCHEEME2_CFLAGS ${input:FromFile} ${pre=-I:_C__INCLUDE} $CXXFLAGS -Wno-error && ${tool:"tools/structparser"} -o ${output:ScheemeName.inc} -n N${ScheemeName}SchemeInfo $SCHEEME2_STRUCT_INFO_FLAGS $DATAWORK_SCHEEME_EXPORT_FLAGS ${tmp:FromFile.cph} ${output;stdout;noauto:ScheemeName.inc.log} ${kv;hide:"p SH"} ${kv;hide:"pc yellow"} -} +} ### @usage: SYMLINK(from to) ### Add symlink -macro SYMLINK(From, To) { - .CMD=$YMAKE_PYTHON ${input:"build/scripts/symlink.py"} ${input;dirallowed:From} ${output;noauto:To} ${kv;hide:"p LN"} ${kv;hide:"pc light-cyan"} -} +macro SYMLINK(From, To) { + .CMD=$YMAKE_PYTHON ${input:"build/scripts/symlink.py"} ${input;dirallowed:From} ${output;noauto:To} ${kv;hide:"p LN"} ${kv;hide:"pc light-cyan"} +} ### @usage: RUN_PROGRAM(tool_path args... [CWD dir] [ENV key=value...] [TOOL tools...] [IN inputs...] [OUT[_NOAUTO] outputs...] [STDOUT[_NOAUTO] output] [OUTPUT_INCLUDES output_includes...] [REQUIREMENTS reqs]) ### @@ -7118,15 +7118,15 @@ otherwise { ### @usage: COMPILE_C_AS_CXX() ### ### Compile .c files as .cpp ones within a module. -macro COMPILE_C_AS_CXX() { - SET(EXTRA_C_FLAGS $C_AS_CXX_FLAGS) +macro COMPILE_C_AS_CXX() { + SET(EXTRA_C_FLAGS $C_AS_CXX_FLAGS) } ### @usage: NO_DEBUG_INFO() ### ### Compile files without debug info collection. -macro NO_DEBUG_INFO() { - SET(NO_DEBUGINFO yes) +macro NO_DEBUG_INFO() { + SET(NO_DEBUGINFO yes) } ### @usage: CTEMPLATE_VARNAMES(File) @@ -7181,7 +7181,7 @@ macro CLANG_EMIT_AST_CXX(Input, Output, Opts...) { ### ### Emit LLVM bytecode from .cpp file. BC_CXXFLAGS, LLVM_OPTS and C_FLAGS_PLATFORM are passed in, while CFLAGS are not. ### Note: Output name is used as is, no extension added. -macro LLVM_COMPILE_CXX(Input, Output, Opts...) { +macro LLVM_COMPILE_CXX(Input, Output, Opts...) { .CMD=$YMAKE_PYTHON ${input:"build/scripts/clang_wrapper.py"} $WINDOWS $CLANG_ROOT/bin/clang++ ${pre=-I:_C__INCLUDE} $BC_CXXFLAGS $C_FLAGS_PLATFORM -Wno-unknown-warning-option $LLVM_OPTS -std=c++17 -fno-lto -emit-llvm -c ${input:Input} -o ${output;noauto:Output} $Opts ${kv;hide:"p BC"} ${kv;hide:"pc light-green"} PEERDIR(build/platform/clang) } @@ -7190,7 +7190,7 @@ macro LLVM_COMPILE_CXX(Input, Output, Opts...) { ### ### Emit LLVM bytecode from .c file. BC_CFLAGS, LLVM_OPTS and C_FLAGS_PLATFORM are passed in, while CFLAGS are not. ### Note: Output name is used as is, no extension added. -macro LLVM_COMPILE_C(Input, Output, Opts...) { +macro LLVM_COMPILE_C(Input, Output, Opts...) { .CMD=$YMAKE_PYTHON ${input:"build/scripts/clang_wrapper.py"} $WINDOWS $CLANG_ROOT/bin/clang ${pre=-I:_C__INCLUDE} $BC_CFLAGS $C_FLAGS_PLATFORM $LLVM_OPTS -fno-lto -emit-llvm -c ${input:Input} -o ${output;noauto:Output} $Opts ${kv;hide:"p BC"} ${kv;hide:"pc light-green"} PEERDIR(build/platform/clang) } @@ -7226,7 +7226,7 @@ macro LLVM_COMPILE_LL(Input, Output, Opts...) { ### ### Call llvm-link on set of Inputs to produce Output. ### Note: Unlike many other macros output argument goes first. Output name is used as is, no extension added. -macro LLVM_LINK(Output, Inputs...) { +macro LLVM_LINK(Output, Inputs...) { .CMD=$CLANG_ROOT/bin/llvm-link ${input:Inputs} -o ${output;noauto:Output} ${kv;hide:"p LD"} ${requirements;hide:LD_REQUIREMENTS} ${kv;hide:"pc light-red"} PEERDIR(build/platform/clang) } @@ -7235,28 +7235,28 @@ macro LLVM_LINK(Output, Inputs...) { ### ### Call llvm-opt with set of Opts on Input to produce Output. ### Note: Output name is used as is, no extension added. -macro LLVM_OPT(Input, Output, Opts...) { - .CMD=$YMAKE_PYTHON ${input:"build/scripts/llvm_opt_wrapper.py"} $CLANG_ROOT/bin/opt ${input:Input} -o ${output;noauto:Output} $Opts ${kv;hide:"p OP"} ${kv;hide:"pc yellow"} +macro LLVM_OPT(Input, Output, Opts...) { + .CMD=$YMAKE_PYTHON ${input:"build/scripts/llvm_opt_wrapper.py"} $CLANG_ROOT/bin/opt ${input:Input} -o ${output;noauto:Output} $Opts ${kv;hide:"p OP"} ${kv;hide:"pc yellow"} PEERDIR(build/platform/clang) } -when ($NO_DEBUGINFO == "yes") { - DEBUG_INFO_FLAGS= -} - -when ($CLANG && $DEBUGINFO_LINES_ONLY == "yes" && $NO_DEBUGINFO != "yes") { - DEBUG_INFO_FLAGS=-gline-tables-only -} +when ($NO_DEBUGINFO == "yes") { + DEBUG_INFO_FLAGS= +} +when ($CLANG && $DEBUGINFO_LINES_ONLY == "yes" && $NO_DEBUGINFO != "yes") { + DEBUG_INFO_FLAGS=-gline-tables-only +} + # TODO: configurable tar and touch PACK_TGZ=${cwd:ARCADIA_BUILD_ROOT} tar -czf ${rootrel:OUTPUT} ${rootrel:INPUT} ${kv;hide:"p AR"} ${kv;hide:"pc light-red"} # tag:internal ### @usage TOUCH(Outputs...) # internal ### Just introduce outputs -macro TOUCH(Outputs...) { - .CMD=$YMAKE_PYTHON ${input:"build/scripts/touch.py"} ${output:Outputs} -} +macro TOUCH(Outputs...) { + .CMD=$YMAKE_PYTHON ${input:"build/scripts/touch.py"} ${output:Outputs} +} TOUCH_UNIT=$YMAKE_PYTHON ${input:"build/scripts/touch.py"} ${kv;hide:"p UN"} ${kv;hide:"pc light-cyan"} $TARGET TOUCH_PACKAGE=$YMAKE_PYTHON ${input:"build/scripts/touch.py"} ${kv;hide:"pc light-red"} $TARGET && $YMAKE_PYTHON ${input:"build/scripts/copy_to_dir.py"} --dest-dir $BINDIR --build-root $ARCADIA_BUILD_ROOT $PACKED_PACKAGE_ARGS $SRCS_GLOBAL $PEERS _P_PK=${kv;hide:"p PK"} @@ -7268,46 +7268,46 @@ NO_CHECK_IMPORTS_FOR_VALUE=None ### ### Do not run checks on imports of Python modules. ### Optional parameter mask patterns describes the names of the modules that do not need to check. -macro NO_CHECK_IMPORTS(Masks...) { - SET(NO_CHECK_IMPORTS_FOR_VALUE $Masks) -} - +macro NO_CHECK_IMPORTS(Masks...) { + SET(NO_CHECK_IMPORTS_FOR_VALUE $Masks) +} + # tag:yasm-specific -_YASM_FMT_VALUE= -_YASM_PLATFORM_FLAGS_VALUE= -_YASM_PREDEFINED_FLAGS_VALUE= -when ($OS_DARWIN || $OS_IOS) { - _YASM_FMT_VALUE=macho - _YASM_PLATFORM_FLAGS_VALUE=-D DARWIN -D UNIX -} -elsewhen ($OS_WINDOWS && $ARCH_X86_64) { - _YASM_FMT_VALUE=win - _YASM_PLATFORM_FLAGS_VALUE=-D WIN64 -} -elsewhen ($OS_WINDOWS && $ARCH_I386) { - _YASM_FMT_VALUE=win - _YASM_PLATFORM_FLAGS_VALUE=-D WIN32 -} -otherwise { - _YASM_FMT_VALUE=elf - _YASM_PLATFORM_FLAGS_VALUE=-D UNIX - _YASM_PREDEFINED_FLAGS_VALUE=-g dwarf2 -} - +_YASM_FMT_VALUE= +_YASM_PLATFORM_FLAGS_VALUE= +_YASM_PREDEFINED_FLAGS_VALUE= +when ($OS_DARWIN || $OS_IOS) { + _YASM_FMT_VALUE=macho + _YASM_PLATFORM_FLAGS_VALUE=-D DARWIN -D UNIX +} +elsewhen ($OS_WINDOWS && $ARCH_X86_64) { + _YASM_FMT_VALUE=win + _YASM_PLATFORM_FLAGS_VALUE=-D WIN64 +} +elsewhen ($OS_WINDOWS && $ARCH_I386) { + _YASM_FMT_VALUE=win + _YASM_PLATFORM_FLAGS_VALUE=-D WIN32 +} +otherwise { + _YASM_FMT_VALUE=elf + _YASM_PLATFORM_FLAGS_VALUE=-D UNIX + _YASM_PREDEFINED_FLAGS_VALUE=-g dwarf2 +} + when ($ASM_PREFIX) { ASM_PREFIX_VALUE=--prefix=$ASM_PREFIX } otherwise { ASM_PREFIX_VALUE= } - + # tag:yasm-specific -YASM_FLAGS= +YASM_FLAGS= YASM_PREINCLUDES_VALUE= - + # tag:yasm-specific -macro _SRC_yasm(SRC, PREINCLUDES[], SRCFLAGS...) { +macro _SRC_yasm(SRC, PREINCLUDES[], SRCFLAGS...) { .CMD=${tool:"contrib/tools/yasm"} -f ${_YASM_FMT_VALUE}${HARDWARE_ARCH} $_YASM_PLATFORM_FLAGS_VALUE $YASM_DEBUG_INFO $YASM_DEBUG_INFO_DISABLE_CACHE__NO_UID__ -D ${pre=_;suf=_:HARDWARE_TYPE} -D_YASM_ $ASM_PREFIX_VALUE $_YASM_PREDEFINED_FLAGS_VALUE $YASM_FLAGS ${pre=-I :_ASM__INCLUDE} $SRCFLAGS -o ${output;noext;suf=${OBJECT_SUF}:SRC} ${pre=-P :PREINCLUDES} ${input;hide:PREINCLUDES} ${input:SRC} ${requirements;hide:PY_REQUIREMENTS} ${kv;hide:"p AS"} ${kv;hide:"pc light-green"} } @@ -7323,63 +7323,63 @@ macro ASM_PREINCLUDE(PREINCLUDES...) { ### ### Version of RUN() macro to invoke Python scripts ### @see: [RUN()](#macro_RUN) -macro RUN_PYTHON(Args...) { +macro RUN_PYTHON(Args...) { SETUP_RUN_PYTHON() RUN(${PYTHON_BIN} $Args) } - -### @usage: RUN_ANTLR(Args...) -### -### Macro to invoke ANTLR3 generator (general case) + +### @usage: RUN_ANTLR(Args...) +### +### Macro to invoke ANTLR3 generator (general case) macro RUN_ANTLR(IN[], OUT[], OUT_NOAUTO[], OUTPUT_INCLUDES[], REQUIREMENTS[], CWD="", Args...) { - PEERDIR(build/external_resources/antlr3) + PEERDIR(build/external_resources/antlr3) _RUN_JAVA(-jar $ANTLR3_RESOURCE_GLOBAL/antlr-3.5.2-complete-no-st3.jar $Args IN $IN OUT $OUT OUT_NOAUTO $OUT_NOAUTO OUTPUT_INCLUDES $OUTPUT_INCLUDES REQUIREMENTS $REQUIREMENTS ${pre=CWD :CWD}) -} - -### @usage: RUN_ANTLR4(Args...) -### -### Macro to invoke ANTLR4 generator (general case) +} + +### @usage: RUN_ANTLR4(Args...) +### +### Macro to invoke ANTLR4 generator (general case) macro RUN_ANTLR4(IN[], OUT[], OUT_NOAUTO[], OUTPUT_INCLUDES[], REQUIREMENTS[], CWD="", Args...) { - PEERDIR(build/external_resources/antlr4) + PEERDIR(build/external_resources/antlr4) _RUN_JAVA(-jar $ANTLR4_RESOURCE_GLOBAL/antlr-4.9-complete.jar $Args IN $IN OUT $OUT OUT_NOAUTO $OUT_NOAUTO OUTPUT_INCLUDES $OUTPUT_INCLUDES REQUIREMENTS $REQUIREMENTS ${pre=CWD :CWD}) -} - -_ANTLR4_LISTENER_GRAMMAR=-listener -_ANTLR4_LISTENER__ANTLR4_EMPTY=-no-listener -_ANTLR4_VISITOR_GRAMMAR=-visitor -_ANTLR4_VISITOR__ANTLR4_EMPTY=-no-visitor - -### @usage: RUN_ANTLR4_CPP(GRAMMAR, OUTPUT_INCLUDES, LISTENER, VISITOR, Args...) -### -### Macro to invoke ANTLR4 generator (Cpp) -macro RUN_ANTLR4_CPP(GRAMMAR, OUTPUT_INCLUDES[], LISTENER?"GRAMMAR":"_ANTLR4_EMPTY", VISITOR?"GRAMMAR":"_ANTLR4_EMPTY", _ANTLR4_EMPTY="", Args...) { - RUN_ANTLR4(${GRAMMAR} -Dlanguage=Cpp -o ${BINDIR} ${Args} ${_ANTLR4_VISITOR_$VISITOR} ${_ANTLR4_LISTENER_$LISTENER} CWD ${BINDIR} IN ${GRAMMAR} OUT ${noext;suf=Lexer.cpp:GRAMMAR} ${noext;suf=Lexer.h:GRAMMAR} ${noext;suf=Parser.cpp:GRAMMAR} ${noext;suf=Parser.h:GRAMMAR} ${noext;suf=Listener.h:$LISTENER} ${noext;suf=BaseListener.h:$LISTENER} ${noext;suf=Visitor.h:$VISITOR} ${noext;suf=BaseVisitor.h:$VISITOR} OUTPUT_INCLUDES ${ARCADIA_ROOT}/contrib/libs/antlr4_cpp_runtime/src/antlr4-runtime.h ${OUTPUT_INCLUDES}) - PEERDIR(contrib/libs/antlr4_cpp_runtime) -} - -### @usage: RUN_ANTLR4_GO(GRAMMAR, OUTPUT_INCLUDES, LISTENER, VISITOR, Args...) -### -### Macro to invoke ANTLR4 generator (Go) -macro RUN_ANTLR4_GO(GRAMMAR, OUTPUT_INCLUDES[], LISTENER?"GRAMMAR":"_ANTLR4_EMPTY", VISITOR?"GRAMMAR":"_ANTLR4_EMPTY", _ANTLR4_EMPTY="", Args...) { - RUN_ANTLR4(${GRAMMAR} -Dlanguage=Go -o ${BINDIR} ${Args} ${_ANTLR4_VISITOR_$VISITOR} ${_ANTLR4_LISTENER_$LISTENER} CWD ${BINDIR} IN ${GRAMMAR} OUT ${noext;tolower;suf=_lexer.go:GRAMMAR} ${noext;tolower;suf=_parser.go:GRAMMAR} ${noext;tolower;suf=_listener.go:$LISTENER} ${noext;tolower;suf=_base_listener.go:$LISTENER} ${noext;tolower;suf=_visitor.go:$VISITOR} ${noext;tolower;suf=_base_visitor.go:$VISITOR} OUTPUT_INCLUDES ${OUTPUT_INCLUDES}) - PEERDIR(${GOSTD}/fmt ${GOSTD}/reflect ${GOSTD}/strconv ${GOSTD}/unicode vendor/github.com/antlr/antlr4/runtime/Go/antlr) -} - +} + +_ANTLR4_LISTENER_GRAMMAR=-listener +_ANTLR4_LISTENER__ANTLR4_EMPTY=-no-listener +_ANTLR4_VISITOR_GRAMMAR=-visitor +_ANTLR4_VISITOR__ANTLR4_EMPTY=-no-visitor + +### @usage: RUN_ANTLR4_CPP(GRAMMAR, OUTPUT_INCLUDES, LISTENER, VISITOR, Args...) +### +### Macro to invoke ANTLR4 generator (Cpp) +macro RUN_ANTLR4_CPP(GRAMMAR, OUTPUT_INCLUDES[], LISTENER?"GRAMMAR":"_ANTLR4_EMPTY", VISITOR?"GRAMMAR":"_ANTLR4_EMPTY", _ANTLR4_EMPTY="", Args...) { + RUN_ANTLR4(${GRAMMAR} -Dlanguage=Cpp -o ${BINDIR} ${Args} ${_ANTLR4_VISITOR_$VISITOR} ${_ANTLR4_LISTENER_$LISTENER} CWD ${BINDIR} IN ${GRAMMAR} OUT ${noext;suf=Lexer.cpp:GRAMMAR} ${noext;suf=Lexer.h:GRAMMAR} ${noext;suf=Parser.cpp:GRAMMAR} ${noext;suf=Parser.h:GRAMMAR} ${noext;suf=Listener.h:$LISTENER} ${noext;suf=BaseListener.h:$LISTENER} ${noext;suf=Visitor.h:$VISITOR} ${noext;suf=BaseVisitor.h:$VISITOR} OUTPUT_INCLUDES ${ARCADIA_ROOT}/contrib/libs/antlr4_cpp_runtime/src/antlr4-runtime.h ${OUTPUT_INCLUDES}) + PEERDIR(contrib/libs/antlr4_cpp_runtime) +} + +### @usage: RUN_ANTLR4_GO(GRAMMAR, OUTPUT_INCLUDES, LISTENER, VISITOR, Args...) +### +### Macro to invoke ANTLR4 generator (Go) +macro RUN_ANTLR4_GO(GRAMMAR, OUTPUT_INCLUDES[], LISTENER?"GRAMMAR":"_ANTLR4_EMPTY", VISITOR?"GRAMMAR":"_ANTLR4_EMPTY", _ANTLR4_EMPTY="", Args...) { + RUN_ANTLR4(${GRAMMAR} -Dlanguage=Go -o ${BINDIR} ${Args} ${_ANTLR4_VISITOR_$VISITOR} ${_ANTLR4_LISTENER_$LISTENER} CWD ${BINDIR} IN ${GRAMMAR} OUT ${noext;tolower;suf=_lexer.go:GRAMMAR} ${noext;tolower;suf=_parser.go:GRAMMAR} ${noext;tolower;suf=_listener.go:$LISTENER} ${noext;tolower;suf=_base_listener.go:$LISTENER} ${noext;tolower;suf=_visitor.go:$VISITOR} ${noext;tolower;suf=_base_visitor.go:$VISITOR} OUTPUT_INCLUDES ${OUTPUT_INCLUDES}) + PEERDIR(${GOSTD}/fmt ${GOSTD}/reflect ${GOSTD}/strconv ${GOSTD}/unicode vendor/github.com/antlr/antlr4/runtime/Go/antlr) +} + # tag:cpp-specific macro CPP_ADDINCL(Dirs...) { ADDINCL($Dirs) } # tag:internal -_WHOLE_ARCHIVE_PEERS_VALUE= -### @usage: WHOLE_ARCHIVE(dirnames...) # internal -macro WHOLE_ARCHIVE(PEERS...) { - SET_APPEND(_WHOLE_ARCHIVE_PEERS_VALUE ${PEERS}) - REQUIRES(${PEERS}) -} - -ANDROID_SDK_ROOT=${ANDROID_SDK_RESOURCE_GLOBAL}/android_sdk - +_WHOLE_ARCHIVE_PEERS_VALUE= +### @usage: WHOLE_ARCHIVE(dirnames...) # internal +macro WHOLE_ARCHIVE(PEERS...) { + SET_APPEND(_WHOLE_ARCHIVE_PEERS_VALUE ${PEERS}) + REQUIRES(${PEERS}) +} + +ANDROID_SDK_ROOT=${ANDROID_SDK_RESOURCE_GLOBAL}/android_sdk + macro TASKLET() { PEERDIR(tasklet/api) @@ -7480,8 +7480,8 @@ multimodule PROTO_LIBRARY { .ALLOWED=EXPOSE # TODO(svidyuk): think about marker which forces semantics inheritance .SEM=PROTO_LIBRARY_SEM - ENABLE(CPP_PROTO) - ENABLE(GEN_PROTO) + ENABLE(CPP_PROTO) + ENABLE(GEN_PROTO) NO_CLANG_TIDY() SET(PEERDIR_TAGS CPP_PROTO) @@ -7503,10 +7503,10 @@ multimodule PROTO_LIBRARY { .ALLOWED=GRPC .SEM=ignored SET(PEERDIR_TAGS JAVA_PROTO) - ENABLE(JAVA_PROTO) + ENABLE(JAVA_PROTO) PEERDIR+=$JAVA_PROTOBUF_PEERS contrib/java/javax/annotation/javax.annotation-api/1.3.1 - .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER USE_SKIFF CPP_PROTO_PLUGIN2 PY_PROTO_PLUGIN YMAPS_SPROTO RESOURCE + .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER USE_SKIFF CPP_PROTO_PLUGIN2 PY_PROTO_PLUGIN YMAPS_SPROTO RESOURCE ADDINCL(FOR proto $PROTOBUF_PATH) when ($_COMMON_GOOGLE_APIS != "None") { @@ -7521,7 +7521,7 @@ multimodule PROTO_LIBRARY { .PEERDIRSELF=CPP_PROTO .SEM=ignored SET(PEERDIR_TAGS PY2 PY_PROTO) - ENABLE(PY_PROTO) + ENABLE(PY_PROTO) OPTIMIZE_PY_PROTOS() OBJ_SUF=.py2 # Can not use NO_LINT(), because is not allowed outside of contrib directory @@ -7545,7 +7545,7 @@ multimodule PROTO_LIBRARY { .PEERDIRSELF=CPP_PROTO .SEM=ignored SET(PEERDIR_TAGS PY3 PY3_PROTO) - ENABLE(PY3_PROTO) + ENABLE(PY3_PROTO) OPTIMIZE_PY_PROTOS() when ($MSVC == "yes" || $CYGWIN == "yes") { MODULE_PREFIX=py3 @@ -7568,12 +7568,12 @@ multimodule PROTO_LIBRARY { } SET_APPEND(_WHOLE_ARCHIVE_LIBS_VALUE_GLOBAL $_CPP_PROTO_LIBRARY) } - - module GO_PROTO: GO_LIBRARY { + + module GO_PROTO: GO_LIBRARY { .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER YMAPS_SPROTO .SEM=ignored - SET(PEERDIR_TAGS GO GO_PROTO) - ENABLE(GO_PROTO) + SET(PEERDIR_TAGS GO GO_PROTO) + ENABLE(GO_PROTO) when ($_COMMON_GOOGLE_APIS == "None") { } @@ -7585,26 +7585,26 @@ multimodule PROTO_LIBRARY { PEERDIR += $_COMMON_GOOGLE_APIS ADDINCL += FOR proto ${ARCADIA_ROOT}/contrib/libs/googleapis-common-protos } - } - + } + module EXT_PROTO: _BARE_UNIT { - .ALIASES=SRCS=_RAW_PROTO_SRCS - .CMD=TOUCH_UNIT_MF + .ALIASES=SRCS=_RAW_PROTO_SRCS + .CMD=TOUCH_UNIT_MF .SEM=ignored - .EXTS=.* - .PROXY=yes - .PEERDIR_POLICY=as_build_from - SET(PEERDIR_TAGS EXT_PROTO) - ENABLE(EXT_PROTO) - SET(MODULE_SUFFIX .raw.fake.pkg) - SET(MODULE_TYPE LIBRARY) + .EXTS=.* + .PROXY=yes + .PEERDIR_POLICY=as_build_from + SET(PEERDIR_TAGS EXT_PROTO) + ENABLE(EXT_PROTO) + SET(MODULE_SUFFIX .raw.fake.pkg) + SET(MODULE_TYPE LIBRARY) when ($_COMMON_GOOGLE_APIS != "None") { PEERDIR += contrib/libs/googleapis-common-protos } SET(CREDITS_FILE_EXTRA_EXT .ext_proto) - } - + } + module DESC_PROTO: _BARE_UNIT { .CMD=_PROTO_DESC_MERGE_CMD .SEM=ignored @@ -7634,52 +7634,52 @@ multimodule PROTO_LIBRARY { } } - module PB_PY_PROTO: _PY_PACKAGE { - .INCLUDE_TAG=no - .PROXY=yes + module PB_PY_PROTO: _PY_PACKAGE { + .INCLUDE_TAG=no + .PROXY=yes .SEM=ignored - SET(MODULE_SUFFIX .pb_py.fake.pkg) - ENABLE(PB_PY_PROTO) + SET(MODULE_SUFFIX .pb_py.fake.pkg) + ENABLE(PB_PY_PROTO) # WARN: # _COMMON_GOOGLE_APIS aren't handled intentionally. # PB_PY_PROTO is a legacy module type, stop using it. - } + } } # tag:proto -_EXT_PROTO_DIR=_RAW_ - +_EXT_PROTO_DIR=_RAW_ + # tag:proto -### This var defines the root of the tree for copied proto files from EXT_PROTO -### submodule of PROTO_LIBRARY module -EXT_PROTO_ROOT=${ARCADIA_BUILD_ROOT}/${_EXT_PROTO_DIR} - +### This var defines the root of the tree for copied proto files from EXT_PROTO +### submodule of PROTO_LIBRARY module +EXT_PROTO_ROOT=${ARCADIA_BUILD_ROOT}/${_EXT_PROTO_DIR} + # tag:proto -### @usage: USE_EXT_PROTO(peerdir_tag...) -### -### Configure module to use proto files from existing PROTO_LIBRARY module. +### @usage: USE_EXT_PROTO(peerdir_tag...) +### +### Configure module to use proto files from existing PROTO_LIBRARY module. ### Additional PEERDIR tags required to build a module can be passed through -### EXTRA_TAGS vararg parameter. -macro USE_EXT_PROTO(EXTRA_TAGS...) { - SET(PEERDIR_TAGS EXT_PROTO ${EXTRA_TAGS}) - SRCDIR(${EXT_PROTO_ROOT}) -} - +### EXTRA_TAGS vararg parameter. +macro USE_EXT_PROTO(EXTRA_TAGS...) { + SET(PEERDIR_TAGS EXT_PROTO ${EXTRA_TAGS}) + SRCDIR(${EXT_PROTO_ROOT}) +} + # tag:proto tag:internal -### @usage: _RAW_PROTO_SRCS(files...) # internal -### -### _RAW_PROTO_SRCS is a proxy macro to FILES macro which filters out -### GLOBAL keyword from the list of files (NOTE! The order of files listed -### originally in call to _RAW_PROTO_SRCS() macro is changed in call to -### FILES() macro). Currently this macro copies only files with the following -### extensions: .proto, .gztproto, .ev -macro _RAW_PROTO_SRCS(FILES...) { - COPY_FILES_TO_BUILD_PREFIX(${ext=.proto:FILES} PREFIX ${_EXT_PROTO_DIR}) - COPY_FILES_TO_BUILD_PREFIX(${ext=.gztproto:FILES} PREFIX ${_EXT_PROTO_DIR}) - COPY_FILES_TO_BUILD_PREFIX(${ext=.ev:FILES} PREFIX ${_EXT_PROTO_DIR}) -} - +### @usage: _RAW_PROTO_SRCS(files...) # internal +### +### _RAW_PROTO_SRCS is a proxy macro to FILES macro which filters out +### GLOBAL keyword from the list of files (NOTE! The order of files listed +### originally in call to _RAW_PROTO_SRCS() macro is changed in call to +### FILES() macro). Currently this macro copies only files with the following +### extensions: .proto, .gztproto, .ev +macro _RAW_PROTO_SRCS(FILES...) { + COPY_FILES_TO_BUILD_PREFIX(${ext=.proto:FILES} PREFIX ${_EXT_PROTO_DIR}) + COPY_FILES_TO_BUILD_PREFIX(${ext=.gztproto:FILES} PREFIX ${_EXT_PROTO_DIR}) + COPY_FILES_TO_BUILD_PREFIX(${ext=.ev:FILES} PREFIX ${_EXT_PROTO_DIR}) +} + module PROTO_DESCRIPTIONS: _BARE_UNIT { .CMD=_PROTO_DESC_MERGE_PEERS_CMD .PEERDIR_POLICY=as_build_from @@ -7697,166 +7697,166 @@ module PROTO_REGISTRY: PROTO_DESCRIPTIONS { } # tag:fbs -_FBS_NAMESPACE_MAP_GLOBAL= - +_FBS_NAMESPACE_MAP_GLOBAL= + # tag:fbs -macro _FBS_NAMESPACE_IMPL(NAMESPACE, PATH, DUMMY...) { - SET_APPEND(_FBS_NAMESPACE_MAP_GLOBAL ${NAMESPACE}=${PATH}) -} - +macro _FBS_NAMESPACE_IMPL(NAMESPACE, PATH, DUMMY...) { + SET_APPEND(_FBS_NAMESPACE_MAP_GLOBAL ${NAMESPACE}=${PATH}) +} + # tag:fbs -macro FBS_NAMESPACE(NAMESPACE, PATH...) { - _FBS_NAMESPACE_IMPL($NAMESPACE $PATH $MODDIR) -} - +macro FBS_NAMESPACE(NAMESPACE, PATH...) { + _FBS_NAMESPACE_IMPL($NAMESPACE $PATH $MODDIR) +} + # tag:fbs -### @usage: FBS_LIBRARY() -### -### Build some variant of Flatbuffers library. -### -### The particular variant is selected based on where PEERDIR to FBS_LIBRARY -### comes from. -### -### Now supported 5 variants: C++, Java, Python 2.x, Python 3.x and Go. -### When PEERDIR comes from module for particular language appropriate variant -### is selected. -### -### Notes: FBS_NAMESPACE must be specified in all dependent FBS_LIBRARY modules -### if build of Go code is requested. -multimodule FBS_LIBRARY { - module CPP_FBS: LIBRARY { - ENABLE(CPP_FBS) - SET(PEERDIR_TAGS CPP_FBS) - } - - module GO_FBS: GO_LIBRARY { - .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER - ENABLE(GO_FBS) - SET(PEERDIR_TAGS GO GO_FBS) - } - - module JAVA_FBS: EXTERNAL_JAVA_LIBRARY { - .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER - ENABLE(JAVA_FBS) - SET(PEERDIR_TAGS JAVA_FBS) - } - - module PY2_FBS: PY2_LIBRARY { - .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER - .ALIASES=SRCS=PY_SRCS - ENABLE(PY2_FBS) - SET(PEERDIR_TAGS PY2 PY2_FBS) - # Can not use NO_LINT(), because is not allowed outside of contrib directory - SET(LINT_LEVEL_VALUE none_internal) - } - - module PY3_FBS: PY3_LIBRARY { - .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER - .ALIASES=SRCS=PY_SRCS - ENABLE(PY3_FBS) - SET(PEERDIR_TAGS PY3 PY3_FBS) - # Can not use NO_LINT(), because is not allowed outside of contrib directory - SET(LINT_LEVEL_VALUE none_internal) - when ($MSVC == "yes" || $CYGWIN == "yes") { - MODULE_PREFIX=py3 - } - otherwise { - MODULE_PREFIX=libpy3 - } - OBJ_SUF=.py3 - } -} - +### @usage: FBS_LIBRARY() +### +### Build some variant of Flatbuffers library. +### +### The particular variant is selected based on where PEERDIR to FBS_LIBRARY +### comes from. +### +### Now supported 5 variants: C++, Java, Python 2.x, Python 3.x and Go. +### When PEERDIR comes from module for particular language appropriate variant +### is selected. +### +### Notes: FBS_NAMESPACE must be specified in all dependent FBS_LIBRARY modules +### if build of Go code is requested. +multimodule FBS_LIBRARY { + module CPP_FBS: LIBRARY { + ENABLE(CPP_FBS) + SET(PEERDIR_TAGS CPP_FBS) + } + + module GO_FBS: GO_LIBRARY { + .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER + ENABLE(GO_FBS) + SET(PEERDIR_TAGS GO GO_FBS) + } + + module JAVA_FBS: EXTERNAL_JAVA_LIBRARY { + .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER + ENABLE(JAVA_FBS) + SET(PEERDIR_TAGS JAVA_FBS) + } + + module PY2_FBS: PY2_LIBRARY { + .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER + .ALIASES=SRCS=PY_SRCS + ENABLE(PY2_FBS) + SET(PEERDIR_TAGS PY2 PY2_FBS) + # Can not use NO_LINT(), because is not allowed outside of contrib directory + SET(LINT_LEVEL_VALUE none_internal) + } + + module PY3_FBS: PY3_LIBRARY { + .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER + .ALIASES=SRCS=PY_SRCS + ENABLE(PY3_FBS) + SET(PEERDIR_TAGS PY3 PY3_FBS) + # Can not use NO_LINT(), because is not allowed outside of contrib directory + SET(LINT_LEVEL_VALUE none_internal) + when ($MSVC == "yes" || $CYGWIN == "yes") { + MODULE_PREFIX=py3 + } + otherwise { + MODULE_PREFIX=libpy3 + } + OBJ_SUF=.py3 + } +} + # tag:java-specific _COMPILE_JSRC=${cwd:ARCADIA_BUILD_ROOT} $YMAKE_PYTHON ${input:"build/scripts/compile_jsrc.py"} --input $AUTO_INPUT --output $TARGET --prefix $BINDIR ${requirements;hide:JAVA_REQUIREMENTS} ${kv;hide:"p JC"} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} - + # tag:java-specific -COMPILE_JSRC_MF=$_COMPILE_JSRC && $GENERATE_MF - +COMPILE_JSRC_MF=$_COMPILE_JSRC && $GENERATE_MF + # tag:java-specific tag:internal -### @usage: JSRC_LIBRARY() # internal +### @usage: JSRC_LIBRARY() # internal module JSRC_LIBRARY: _BARE_UNIT { - .CMD=COMPILE_JSRC_MF - .EXTS=.java - .ALL_INS_TO_OUT=no - .PEERDIR_POLICY=as_include - .FINAL_TARGET=no - .ALIASES=SRCS=FILES - PEERDIR_TAGS=JAVA_PROTO JAVA_FBS JAVA_IDL - MODULE_TYPE=Library - SET(MODULE_SUFFIX .jsrc) - SET(DONT_RESOLVE_INCLUDES yes) - SET(NEED_PLATFORM_PEERDIRS no) + .CMD=COMPILE_JSRC_MF + .EXTS=.java + .ALL_INS_TO_OUT=no + .PEERDIR_POLICY=as_include + .FINAL_TARGET=no + .ALIASES=SRCS=FILES + PEERDIR_TAGS=JAVA_PROTO JAVA_FBS JAVA_IDL + MODULE_TYPE=Library + SET(MODULE_SUFFIX .jsrc) + SET(DONT_RESOLVE_INCLUDES yes) + SET(NEED_PLATFORM_PEERDIRS no) SET(MODULE_LANG JAVA) - - NO_RUNTIME() -} - + + NO_RUNTIME() +} + # tag:maps-specific @import "${CONF_ROOT}/conf/project_specific/maps/asrc.conf" - + # tag:internal ### @usage: _PROXY_LIBRARY() # internal -### -### The use of this module is strictly prohibited!!! -module _PROXY_LIBRARY: LIBRARY { - .EXTS=.a .lib - .PEERDIR_POLICY=as_build_from - .PROXY=yes - .FINAL_TARGET=yes - DISABLE(NEED_ADD_FAKE_SRC) - - NO_UTIL() - NO_RUNTIME() -} - +### +### The use of this module is strictly prohibited!!! +module _PROXY_LIBRARY: LIBRARY { + .EXTS=.a .lib + .PEERDIR_POLICY=as_build_from + .PROXY=yes + .FINAL_TARGET=yes + DISABLE(NEED_ADD_FAKE_SRC) + + NO_UTIL() + NO_RUNTIME() +} + # tag:maps-specific @import "${CONF_ROOT}/conf/project_specific/maps/aar.conf" @import "${CONF_ROOT}/conf/project_specific/maps/sproto.conf" @import "${CONF_ROOT}/conf/project_specific/maps/mapkit.conf" -_PRIMARY_OUTPUT_VALUE= - +_PRIMARY_OUTPUT_VALUE= + # tag:internal -### @usage: PRIMARY_OUTPUT_VALUE(Output) # internal -### -### The use of this module is strictly prohibited!!! -macro PRIMARY_OUTPUT(OUTPUT) { - SET(_PRIMARY_OUTPUT_VALUE $OUTPUT) -} - -_DLL_PROXY_LIBRARY_CMD=$GENERATE_MF && $COPY_CMD $_PRIMARY_OUTPUT_VALUE ${input;hide:_PRIMARY_OUTPUT_VALUE} ${TARGET} - +### @usage: PRIMARY_OUTPUT_VALUE(Output) # internal +### +### The use of this module is strictly prohibited!!! +macro PRIMARY_OUTPUT(OUTPUT) { + SET(_PRIMARY_OUTPUT_VALUE $OUTPUT) +} + +_DLL_PROXY_LIBRARY_CMD=$GENERATE_MF && $COPY_CMD $_PRIMARY_OUTPUT_VALUE ${input;hide:_PRIMARY_OUTPUT_VALUE} ${TARGET} + # tag:internal -### @usage: DLL_PROXY_LIBRARY() # internal -### -### The use of this module is strictly prohibited!!! -module DLL_PROXY_LIBRARY: _PROXY_LIBRARY { - .ALLOWED=PRIMARY_OUTPUT - .CMD=_DLL_PROXY_LIBRARY_CMD -} - +### @usage: DLL_PROXY_LIBRARY() # internal +### +### The use of this module is strictly prohibited!!! +module DLL_PROXY_LIBRARY: _PROXY_LIBRARY { + .ALLOWED=PRIMARY_OUTPUT + .CMD=_DLL_PROXY_LIBRARY_CMD +} + _PREBUILT_PROGRAM_CMD=$GENERATE_MF && $COPY_CMD $_PRIMARY_OUTPUT_VALUE ${TARGET} ${kv;hide:"p ld"} ${requirements;hide:LD_REQUIREMENTS} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} - + # tag:internal -### @usage: PREBUILT_PROGRAM([programname]) # internal -### -### Program module which uses a prebuilt prgram as its output. -module PREBUILT_PROGRAM: _LINK_UNIT { - .CMD=_PREBUILT_PROGRAM_CMD - .SYMLINK_POLICY=EXE - .ALLOWED=INDUCED_DEPS PRIMARY_OUTPUT - .RESTRICTED=SRCS - - _BARE_LINK_MODULE() - - SET(MODULE_TYPE PROGRAM) - - when ($WIN32 == "yes" || $OS_CYGWIN == "yes") { - MODULE_SUFFIX=.exe - } -} - +### @usage: PREBUILT_PROGRAM([programname]) # internal +### +### Program module which uses a prebuilt prgram as its output. +module PREBUILT_PROGRAM: _LINK_UNIT { + .CMD=_PREBUILT_PROGRAM_CMD + .SYMLINK_POLICY=EXE + .ALLOWED=INDUCED_DEPS PRIMARY_OUTPUT + .RESTRICTED=SRCS + + _BARE_LINK_MODULE() + + SET(MODULE_TYPE PROGRAM) + + when ($WIN32 == "yes" || $OS_CYGWIN == "yes") { + MODULE_SUFFIX=.exe + } +} + ### @usage COLLECT_JINJA_TEMPLATES(varname path) ### ### This macro collects all jinja and yaml files in the directory specified by second argument and @@ -7866,446 +7866,446 @@ macro COLLECT_JINJA_TEMPLATES(VAR, DIR) { } # tag:go-specific -GO_HOST_OS=unknown -when ($HOST_OS_LINUX) { - GO_HOST_OS=linux -} -elsewhen ($HOST_OS_DARWIN) { - GO_HOST_OS=darwin -} -elsewhen($HOST_OS_WINDOWS) { - GO_HOST_OS=windows -} - +GO_HOST_OS=unknown +when ($HOST_OS_LINUX) { + GO_HOST_OS=linux +} +elsewhen ($HOST_OS_DARWIN) { + GO_HOST_OS=darwin +} +elsewhen($HOST_OS_WINDOWS) { + GO_HOST_OS=windows +} + # tag:go-specific -GO_HOST_ARCH=unknown -when ($HOST_ARCH_X86_64) { - GO_HOST_ARCH=amd64 -} +GO_HOST_ARCH=unknown +when ($HOST_ARCH_X86_64) { + GO_HOST_ARCH=amd64 +} elsewhen($HOST_ARCH_ARM64) { GO_HOST_ARCH=arm64 } - + # tag:go-specific -GO_TARG_OS=unknown -when ($OS_LINUX) { - GO_TARG_OS=linux -} -elsewhen ($OS_DARWIN) { - GO_TARG_OS=darwin -} -elsewhen ($OS_WINDOWS) { - GO_TARG_OS=windows -} - +GO_TARG_OS=unknown +when ($OS_LINUX) { + GO_TARG_OS=linux +} +elsewhen ($OS_DARWIN) { + GO_TARG_OS=darwin +} +elsewhen ($OS_WINDOWS) { + GO_TARG_OS=windows +} + # tag:go-specific -GO_TARG_ARCH=unknwon -when ($ARCH_X86_64) { - GO_TARG_ARCH=amd64 -} -elsewhen ($ARCH_I386) { - GO_TARG_ARCH=x86 -} +GO_TARG_ARCH=unknwon +when ($ARCH_X86_64) { + GO_TARG_ARCH=amd64 +} +elsewhen ($ARCH_I386) { + GO_TARG_ARCH=x86 +} elsewhen ($ARCH_ARM64) { GO_TARG_ARCH=arm64 } - + # tag:go-specific -GO_HOST_TARG_PARAMS=++host-os $GO_HOST_OS ++host-arch $GO_HOST_ARCH ++targ-os $GO_TARG_OS ++targ-arch $GO_TARG_ARCH - +GO_HOST_TARG_PARAMS=++host-os $GO_HOST_OS ++host-arch $GO_HOST_ARCH ++targ-os $GO_TARG_OS ++targ-arch $GO_TARG_ARCH + # tag:go-specific -GOSTD_VERSION=1.17.6 -when ($GOSTD_VERSION == "1.17.6") { - GOSTD=contrib/go/_std/src -} -elsewhen ($GOSTD_VERSION == "1.18beta2") { - GOSTD=contrib/go/_std_1.18beta2/src -} -otherwise { - GOSTD=__unsupported_go_std_library_version_[$GOSTD_VERSION]__ -} - +GOSTD_VERSION=1.17.6 +when ($GOSTD_VERSION == "1.17.6") { + GOSTD=contrib/go/_std/src +} +elsewhen ($GOSTD_VERSION == "1.18beta2") { + GOSTD=contrib/go/_std_1.18beta2/src +} +otherwise { + GOSTD=__unsupported_go_std_library_version_[$GOSTD_VERSION]__ +} + # tag:go-specific -GO_DEBUG_PATH_RELATIVE=no -_GO_DEBUG_PATH__NO_UID__= -_GO_COMPILE_SYMABIS_TRIMPATH__NO_UID__= - +GO_DEBUG_PATH_RELATIVE=no +_GO_DEBUG_PATH__NO_UID__= +_GO_COMPILE_SYMABIS_TRIMPATH__NO_UID__= + # tag:go-specific -_GO_IMPORT_PATH=${MODDIR} - +_GO_IMPORT_PATH=${MODDIR} + # tag:go-specific GO_VET=yolint -GO_VET_TOOL= -GO_VET_FLAGS= -GO_VET_EXTRA_FLAGS= - +GO_VET_TOOL= +GO_VET_FLAGS= +GO_VET_EXTRA_FLAGS= + # tag:go-specific -_GO_VET_ADD_CHECK=yes -_GO_FMT_ADD_CHECK=yes -_GO_YDX_FILE= - +_GO_VET_ADD_CHECK=yes +_GO_FMT_ADD_CHECK=yes +_GO_YDX_FILE= + # tag:go-specific -_GO_CGO1_WRAPPER_FLAGS=--build-prefix=/-B --source-prefix=/-S -_GO_LINK_EXE_EXT_CMD= - +_GO_CGO1_WRAPPER_FLAGS=--build-prefix=/-B --source-prefix=/-S +_GO_LINK_EXE_EXT_CMD= + # tag:go-specific -GO_WITH_MUSL= - +GO_WITH_MUSL= + # tag:go-specific -GO_TOOLS_ROOT=${GO_TOOLS_RESOURCE_GLOBAL} -GO_TEST_MINER=${tool:"tools/go_test_miner"} -GO_TEST_IMPORT_PATH= - +GO_TOOLS_ROOT=${GO_TOOLS_RESOURCE_GLOBAL} +GO_TEST_MINER=${tool:"tools/go_test_miner"} +GO_TEST_IMPORT_PATH= + # tag:go-specific -GO_STD_LIB_PREFIX=${GOSTD}/ -GO_ARCADIA_PROJECT_PREFIX=a.yandex-team.ru/ -GO_CONTRIB_PROJECT_PREFIX=vendor/ -GO_SKIP_IMPORTS=unsafe C -GO_VET_INFO_EXT=.vet.out -GO_VET_REPORT_EXT=.vet.txt -GO_VET_OUTPUT_INFO=${output;rootrel;hide;pre=${MODULE_PREFIX};suf=${MODULE_SUFFIX}${GO_VET_INFO_EXT}:REALPRJNAME} -GO_VET_OUTPUT_REPORT=${output;rootrel;hide;pre=${MODULE_PREFIX};suf=${MODULE_SUFFIX}${GO_VET_REPORT_EXT}:REALPRJNAME} - +GO_STD_LIB_PREFIX=${GOSTD}/ +GO_ARCADIA_PROJECT_PREFIX=a.yandex-team.ru/ +GO_CONTRIB_PROJECT_PREFIX=vendor/ +GO_SKIP_IMPORTS=unsafe C +GO_VET_INFO_EXT=.vet.out +GO_VET_REPORT_EXT=.vet.txt +GO_VET_OUTPUT_INFO=${output;rootrel;hide;pre=${MODULE_PREFIX};suf=${MODULE_SUFFIX}${GO_VET_INFO_EXT}:REALPRJNAME} +GO_VET_OUTPUT_REPORT=${output;rootrel;hide;pre=${MODULE_PREFIX};suf=${MODULE_SUFFIX}${GO_VET_REPORT_EXT}:REALPRJNAME} + # tag:go-specific tag:codenav -_GO_YNDEXER_EXT=.ydx.pb2 -GO_YNDEXER_OUTPUT=${output;pre=${MODULE_PREFIX};suf=${MODULE_SUFFIX}${_GO_YNDEXER_EXT}:REALPRJNAME} - +_GO_YNDEXER_EXT=.ydx.pb2 +GO_YNDEXER_OUTPUT=${output;pre=${MODULE_PREFIX};suf=${MODULE_SUFFIX}${_GO_YNDEXER_EXT}:REALPRJNAME} + # tag:go-specific -GO_PROJECT_PREFIXES=++std-lib-prefix $GO_STD_LIB_PREFIX ++arc-project-prefix $GO_ARCADIA_PROJECT_PREFIX - +GO_PROJECT_PREFIXES=++std-lib-prefix $GO_STD_LIB_PREFIX ++arc-project-prefix $GO_ARCADIA_PROJECT_PREFIX + # tag:go-specific -_GO_FAKEID=${FAKEID}.${BUILD_TYPE}.${GO_FAKEID} - +_GO_FAKEID=${FAKEID}.${BUILD_TYPE}.${GO_FAKEID} + # tag:go-specific -CGO2_CFLAGS_VALUE= -CGO2_LDFLAGS_VALUE= - +CGO2_CFLAGS_VALUE= +CGO2_LDFLAGS_VALUE= + # tag:go-specific -GO_ASM_FLAGS_VALUE= -### @usage: GO_ASM_FLAGS(flags) +GO_ASM_FLAGS_VALUE= +### @usage: GO_ASM_FLAGS(flags) ### Add the specified flags to the go asm compile command line. -macro GO_ASM_FLAGS(Flags...) { - SET_APPEND(GO_ASM_FLAGS_VALUE $Flags) -} - +macro GO_ASM_FLAGS(Flags...) { + SET_APPEND(GO_ASM_FLAGS_VALUE $Flags) +} + # tag:go-specific -GO_CGO1_FLAGS_VALUE= -### @usage: GO_CGO1_FLAGS(flags) -### Add the specified flags to the go cgo compile command line. -macro GO_CGO1_FLAGS(Flags...) { - SET_APPEND(GO_CGO1_FLAGS_VALUE $Flags) -} - +GO_CGO1_FLAGS_VALUE= +### @usage: GO_CGO1_FLAGS(flags) +### Add the specified flags to the go cgo compile command line. +macro GO_CGO1_FLAGS(Flags...) { + SET_APPEND(GO_CGO1_FLAGS_VALUE $Flags) +} + # tag:go-specific -GO_CGO2_FLAGS_VALUE= -### @usage: GO_CGO2_FLAGS(flags) -### Add the specified flags to the go cgo compile command line. -macro GO_CGO2_FLAGS(Flags...) { - SET_APPEND(GO_CGO2_FLAGS_VALUE $Flags) -} - +GO_CGO2_FLAGS_VALUE= +### @usage: GO_CGO2_FLAGS(flags) +### Add the specified flags to the go cgo compile command line. +macro GO_CGO2_FLAGS(Flags...) { + SET_APPEND(GO_CGO2_FLAGS_VALUE $Flags) +} + # tag:go-specific -GO_COMPILE_FLAGS_VALUE=$USER_GO_COMPILE_FLAGS -### @usage: GO_COMPILE_FLAGS(flags) -### Add the specified flags to the go compile command line. -macro GO_COMPILE_FLAGS(Flags...) { - SET_APPEND(GO_COMPILE_FLAGS_VALUE $Flags) -} - +GO_COMPILE_FLAGS_VALUE=$USER_GO_COMPILE_FLAGS +### @usage: GO_COMPILE_FLAGS(flags) +### Add the specified flags to the go compile command line. +macro GO_COMPILE_FLAGS(Flags...) { + SET_APPEND(GO_COMPILE_FLAGS_VALUE $Flags) +} + # tag:go-specific -GO_LINK_FLAGS_VALUE=$USER_GO_LINK_FLAGS -### @usage: GO_LINK_FLAGS(flags) -### Add the specified flags to the go link command line. -macro GO_LINK_FLAGS(Flags...) { - SET_APPEND(GO_LINK_FLAGS_VALUE $Flags) -} - +GO_LINK_FLAGS_VALUE=$USER_GO_LINK_FLAGS +### @usage: GO_LINK_FLAGS(flags) +### Add the specified flags to the go link command line. +macro GO_LINK_FLAGS(Flags...) { + SET_APPEND(GO_LINK_FLAGS_VALUE $Flags) +} + # tag:go-specific -_GO_TOOL_MODE= - +_GO_TOOL_MODE= + # tag:go-specific -_GO_TOOL_COMMON_FLAGS=\ - ++mode $_GO_TOOL_MODE \ - $GO_PROJECT_PREFIXES \ - ++goversion $GOSTD_VERSION \ - ++source-root $ARCADIA_ROOT \ - ++build-root $ARCADIA_BUILD_ROOT \ - ++output-root $BINDIR \ - ++toolchain-root $GO_TOOLS_ROOT \ - $GO_HOST_TARG_PARAMS \ - ++output $TARGET \ - $GO_VET_OUTPUT \ - $_GO_YDX_FILE \ - $_GO_DEBUG_PATH__NO_UID__ \ - ++srcs $AUTO_INPUT ${input:GO_FILES} \ - ++asm-flags $GO_ASM_FLAGS_VALUE \ - ++compile-flags $GO_COMPILE_FLAGS_VALUE \ - ++link-flags $GO_LINK_FLAGS_VALUE \ - ++cgo-srcs ${input:CGO_FILES} \ - $_GO_EMBED_VALUE \ +_GO_TOOL_COMMON_FLAGS=\ + ++mode $_GO_TOOL_MODE \ + $GO_PROJECT_PREFIXES \ + ++goversion $GOSTD_VERSION \ + ++source-root $ARCADIA_ROOT \ + ++build-root $ARCADIA_BUILD_ROOT \ + ++output-root $BINDIR \ + ++toolchain-root $GO_TOOLS_ROOT \ + $GO_HOST_TARG_PARAMS \ + ++output $TARGET \ + $GO_VET_OUTPUT \ + $_GO_YDX_FILE \ + $_GO_DEBUG_PATH__NO_UID__ \ + ++srcs $AUTO_INPUT ${input:GO_FILES} \ + ++asm-flags $GO_ASM_FLAGS_VALUE \ + ++compile-flags $GO_COMPILE_FLAGS_VALUE \ + ++link-flags $GO_LINK_FLAGS_VALUE \ + ++cgo-srcs ${input:CGO_FILES} \ + $_GO_EMBED_VALUE \ $GO_TOOLCHAIN_ENV - + # tag:go-specific -macro _GO_GEN_COVER_GO(GO_FILE, VAR_ID) { - .CMD=${hide:_GO_FAKEID} $GO_TOOLS_ROOT/pkg/tool/${GO_HOST_OS}_${GO_HOST_ARCH}/cover -mode set -var $VAR_ID -o ${output;noext;suf=.cover.go:GO_FILE} ${input:GO_FILE} -} - +macro _GO_GEN_COVER_GO(GO_FILE, VAR_ID) { + .CMD=${hide:_GO_FAKEID} $GO_TOOLS_ROOT/pkg/tool/${GO_HOST_OS}_${GO_HOST_ARCH}/cover -mode set -var $VAR_ID -o ${output;noext;suf=.cover.go:GO_FILE} ${input:GO_FILE} +} + # tag:go-specific -macro _GO_COMPILE_SYMABIS(FLAGS[], ASM_FILES...) { - .CMD=${hide:_GO_FAKEID} $GO_TOOLS_ROOT/pkg/tool/${GO_HOST_OS}_${GO_HOST_ARCH}/asm $_GO_COMPILE_SYMABIS_TRIMPATH__NO_UID__ ${pre=-I :_C__INCLUDE} -I $GO_TOOLS_ROOT/pkg/include -D GOOS_${GO_TARG_OS} -D GOARCH_${GO_TARG_ARCH} $FLAGS $GO_ASM_FLAGS_VALUE -gensymabis -o ${output:"gen.symabis"} ${input:ASM_FILES} ${kv;hide:"p go"} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} - .ADDINCL=build/scripts/go_fake_include -} - +macro _GO_COMPILE_SYMABIS(FLAGS[], ASM_FILES...) { + .CMD=${hide:_GO_FAKEID} $GO_TOOLS_ROOT/pkg/tool/${GO_HOST_OS}_${GO_HOST_ARCH}/asm $_GO_COMPILE_SYMABIS_TRIMPATH__NO_UID__ ${pre=-I :_C__INCLUDE} -I $GO_TOOLS_ROOT/pkg/include -D GOOS_${GO_TARG_OS} -D GOARCH_${GO_TARG_ARCH} $FLAGS $GO_ASM_FLAGS_VALUE -gensymabis -o ${output:"gen.symabis"} ${input:ASM_FILES} ${kv;hide:"p go"} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} + .ADDINCL=build/scripts/go_fake_include +} + # tag:go-specific macro _GO_COMPILE_CGO1(NAME, FLAGS[], FILES...) { - .CMD=${hide:_GO_FAKEID} ${cwd:ARCADIA_ROOT} $YMAKE_PYTHON ${input:"build/scripts/cgo1_wrapper.py"} $_GO_CGO1_WRAPPER_FLAGS --build-root ${ARCADIA_BUILD_ROOT} --source-root ${ARCADIA_ROOT} --cgo1-files ${output;noext:FILES.cgo1.go} --cgo2-files ${output;noauto;noext:FILES.cgo2.c} -- ${GO_TOOLS_ROOT}/pkg/tool/${GO_HOST_OS}_${GO_HOST_ARCH}/cgo -objdir $BINDIR -importpath $NAME $GO_CGO1_FLAGS_VALUE $FLAGS -- $C_FLAGS_PLATFORM ${pre=-I:_C__INCLUDE} ${CGO_CFLAGS_VALUE} ${input:FILES} ${output;hide:"_cgo_export.h"} ${output;hide:"_cgo_export.c"} ${output;hide:"_cgo_gotypes.go"} ${output;noauto;hide:"_cgo_main.c"} ${output;noauto;hide:"_cgo_flags"} $GO_TOOLCHAIN_ENV ${kv;hide:"p go"} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} -} - + .CMD=${hide:_GO_FAKEID} ${cwd:ARCADIA_ROOT} $YMAKE_PYTHON ${input:"build/scripts/cgo1_wrapper.py"} $_GO_CGO1_WRAPPER_FLAGS --build-root ${ARCADIA_BUILD_ROOT} --source-root ${ARCADIA_ROOT} --cgo1-files ${output;noext:FILES.cgo1.go} --cgo2-files ${output;noauto;noext:FILES.cgo2.c} -- ${GO_TOOLS_ROOT}/pkg/tool/${GO_HOST_OS}_${GO_HOST_ARCH}/cgo -objdir $BINDIR -importpath $NAME $GO_CGO1_FLAGS_VALUE $FLAGS -- $C_FLAGS_PLATFORM ${pre=-I:_C__INCLUDE} ${CGO_CFLAGS_VALUE} ${input:FILES} ${output;hide:"_cgo_export.h"} ${output;hide:"_cgo_export.c"} ${output;hide:"_cgo_gotypes.go"} ${output;noauto;hide:"_cgo_main.c"} ${output;noauto;hide:"_cgo_flags"} $GO_TOOLCHAIN_ENV ${kv;hide:"p go"} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} +} + # tag:go-specific -macro _GO_COMPILE_CGO2(NAME, C_FILES[], S_FILES[], OBJ_FILES[], FILES...) { +macro _GO_COMPILE_CGO2(NAME, C_FILES[], S_FILES[], OBJ_FILES[], FILES...) { .CMD=${hide:_GO_FAKEID} $C_COMPILER $C_FLAGS_PLATFORM ${pre=-I:_C__INCLUDE} $CGO_CFLAGS_VALUE ${input;tobindir:"_cgo_main.c"} -c -o ${tmp;noauto;suf=${OBJECT_SUF}:"_cgo_main.c"} && $C_COMPILER $C_FLAGS_PLATFORM ${pre=-I:_C__INCLUDE} -o ${tmp;noauto;suf=${OBJECT_SUF}:"_cgo_"} $LDFLAGS $LDFLAGS_GLOBAL $CGO2_LDFLAGS_VALUE ${input;hide:"_cgo_export.h"} ${tmp;noauto;suf=${OBJECT_SUF}:"_cgo_main.c"} ${input;suf=${OBJECT_SUF}:"_cgo_export.c"} ${input;nopath;noext;suf=.cgo2.c${OBJECT_SUF}:FILES} ${input;suf=${OBJECT_SUF}:C_FILES} ${input;suf=.o:S_FILES} ${input:OBJ_FILES} $CGO_LDFLAGS_VALUE && ${GO_TOOLS_ROOT}/pkg/tool/${GO_HOST_OS}_${GO_HOST_ARCH}/cgo -dynpackage $NAME -dynimport ${tmp;noauto;suf=${OBJECT_SUF}:"_cgo_"} -dynout ${output:"_cgo_import.go"} -dynlinker $GO_CGO2_FLAGS_VALUE $GO_TOOLCHAIN_ENV ${requirements;hide:CC_REQUIREMENTS} ${kv;hide:"p go"} ${kv;hide:"pc light-blue"} ${kv;hide:"show_out"} _USE_LINKER() -} - +} + # tag:go-specific -macro _GO_LINK_LIB_IMPL(CGO_FILES[], EXTRA_INPUTS[], GO_FILES...) { +macro _GO_LINK_LIB_IMPL(CGO_FILES[], EXTRA_INPUTS[], GO_FILES...) { .CMD=${hide:_GO_FAKEID} $YMAKE_PYTHON ${input:"build/scripts/go_tool.py"} ${hide;input:EXTRA_INPUTS} --ya-start-command-file $_GO_TOOL_COMMON_FLAGS ++peers ${rootrel;tags_in=local,GO|local,GO_PROTO|local,GO_FBS:PEERS} --ya-end-command-file ${requirements;hide:LIB_REQUIREMENTS} ${kv;hide:"p GO"} ${kv;hide:"pc light-red"} ${kv;hide:"show_out"} -} - +} + # tag:go-specific -macro _GO_LINK_EXE_IMPL(CGO_FILES[], EXTRA_INPUTS[], GO_FILES...) { +macro _GO_LINK_EXE_IMPL(CGO_FILES[], EXTRA_INPUTS[], GO_FILES...) { .CMD=${hide:_GO_FAKEID} $YMAKE_PYTHON ${input:"build/scripts/go_tool.py"} ${hide;input:EXTRA_INPUTS} --ya-start-command-file $_GO_TOOL_COMMON_FLAGS ++vcs $VCS_GO $GO_WITH_MUSL $GO_EXTLD ++peers ${rootrel;tags_in=local,GO|local,GO_PROTO|local,GO_FBS:PEERS} ++non-local-peers ${rootrel;tags_in=GO|GO_PROTO|GO_FBS;tags_out=local:PEERS} ++cgo-peers ${VCS_C_OBJ_RR} ${rootrel;tags_out=GO|GO_PROTO|GO_FBS:PEERS} --ya-end-command-file ${requirements;hide:LD_REQUIREMENTS} ${kv;hide:"p LD"} ${kv;hide:"pc light-red"} ${kv;hide:"show_out"} $_GO_LINK_EXE_EXT_CMD -} - +} + # tag:go-specific -macro _GO_LINK_TEST_IMPL(CGO_FILES[], EXTRA_INPUTS[], GO_TEST_FILES[], GO_XTEST_FILES[], GO_FILES...) { +macro _GO_LINK_TEST_IMPL(CGO_FILES[], EXTRA_INPUTS[], GO_TEST_FILES[], GO_XTEST_FILES[], GO_FILES...) { .CMD=${hide:_GO_FAKEID} $YMAKE_PYTHON ${input:"build/scripts/go_tool.py"} ${hide;input:EXTRA_INPUTS} --ya-start-command-file $_GO_TOOL_COMMON_FLAGS ++vcs $VCS_GO $GO_WITH_MUSL $GO_EXTLD ++test-miner $GO_TEST_MINER ++test-import-path $GO_TEST_IMPORT_PATH ++peers ${rootrel;tags_in=local,GO|local,GO_PROTO|local,GO_FBS:PEERS} ++non-local-peers ${rootrel;tags_in=GO|GO_PROTO|GO_FBS;tags_out=local:PEERS} ++cgo-peers ${VCS_C_OBJ_RR} ${rootrel;tags_out=GO|GO_PROTO|GO_FBS:PEERS} ++test_srcs ${input:GO_TEST_FILES} ++xtest_srcs ${input:GO_XTEST_FILES} ++cover_info $GO_COVER_INFO_VALUE ++skip-tests $_GO_SKIP_TEST_VALUE --ya-end-command-file ${requirements;hide:LD_REQUIREMENTS} ${kv;hide:"p GO"} ${kv;hide:"pc light-red"} ${kv;hide:"show_out"} -} - +} + # tag:go-specific -GO_LINK_LIB=$GENERATE_MF && $_GO_LINK_LIB_IMPL($_GO_SRCS_VALUE CGO_FILES $_CGO_SRCS_VALUE EXTRA_INPUTS $_GO_EMBED_INPUTS) -GO_LINK_EXE=$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $GENERATE_VCS_GO_INFO_NODEP && $_GO_LINK_EXE_IMPL($_GO_SRCS_VALUE CGO_FILES $_CGO_SRCS_VALUE EXTRA_INPUTS $_GO_EMBED_INPUTS) -GO_LINK_TEST=$GENERATE_VCS_C_INFO_NODEP && $GENERATE_VCS_GO_INFO_NODEP && $_GO_LINK_TEST_IMPL($_GO_SRCS_VALUE CGO_FILES $_CGO_SRCS_VALUE EXTRA_INPUTS $_GO_EMBED_INPUTS GO_TEST_FILES $_GO_TEST_SRCS_VALUE GO_XTEST_FILES $_GO_XTEST_SRCS_VALUE) -GO_LINK_DLL=$GO_LINK_EXE && $COPY_CMD $BINDIR/_cgo_export.h ${output;pre=${MODULE_PREFIX};suf=.h:REALPRJNAME} - +GO_LINK_LIB=$GENERATE_MF && $_GO_LINK_LIB_IMPL($_GO_SRCS_VALUE CGO_FILES $_CGO_SRCS_VALUE EXTRA_INPUTS $_GO_EMBED_INPUTS) +GO_LINK_EXE=$GENERATE_MF && $GENERATE_VCS_C_INFO_NODEP && $GENERATE_VCS_GO_INFO_NODEP && $_GO_LINK_EXE_IMPL($_GO_SRCS_VALUE CGO_FILES $_CGO_SRCS_VALUE EXTRA_INPUTS $_GO_EMBED_INPUTS) +GO_LINK_TEST=$GENERATE_VCS_C_INFO_NODEP && $GENERATE_VCS_GO_INFO_NODEP && $_GO_LINK_TEST_IMPL($_GO_SRCS_VALUE CGO_FILES $_CGO_SRCS_VALUE EXTRA_INPUTS $_GO_EMBED_INPUTS GO_TEST_FILES $_GO_TEST_SRCS_VALUE GO_XTEST_FILES $_GO_XTEST_SRCS_VALUE) +GO_LINK_DLL=$GO_LINK_EXE && $COPY_CMD $BINDIR/_cgo_export.h ${output;pre=${MODULE_PREFIX};suf=.h:REALPRJNAME} + # tag:go-specific CGO_ENABLED=yes -when ($OS_WINDOWS == "yes" || $SANITIZER_TYPE && $SANITIZER_TYPE != "no") { +when ($OS_WINDOWS == "yes" || $SANITIZER_TYPE && $SANITIZER_TYPE != "no") { CGO_ENABLED=no } # tag:go-specific -GO_PACKAGE_VALUE= +GO_PACKAGE_VALUE= ### @usage: GO_PACKAGE_NAME(Name) ### Override name of a Go package. -macro GO_PACKAGE_NAME(NAME) { - SET(GO_PACKAGE_VALUE $NAME) -} - +macro GO_PACKAGE_NAME(NAME) { + SET(GO_PACKAGE_VALUE $NAME) +} + # tag:go-specific tag:internal -_GO_SRCS_VALUE= -### @usage: _GO_SRCS(Files...) # internal +_GO_SRCS_VALUE= +### @usage: _GO_SRCS(Files...) # internal ### This macro shouldn't be used in ya.make files, use SRCS() instead. ### This is internal macro collecting .go sources for processing within Go modules (GO_PROGRAM and GO_LIBRARY) -macro _GO_SRCS(FILES...) { +macro _GO_SRCS(FILES...) { GO_FAKE_OUTPUT($FILES) - SET_APPEND(_GO_SRCS_VALUE $FILES) -} - + SET_APPEND(_GO_SRCS_VALUE $FILES) +} + # tag:go-specific -_GO_TEST_SRCS_VALUE= +_GO_TEST_SRCS_VALUE= ### @usage: GO_TEST_SRCS(Files...) ### .go sources for internal tests of a module -macro GO_TEST_SRCS(FILES...) { +macro GO_TEST_SRCS(FILES...) { GO_FAKE_OUTPUT($FILES) - SET_APPEND(_GO_TEST_SRCS_VALUE $FILES) -} - + SET_APPEND(_GO_TEST_SRCS_VALUE $FILES) +} + # tag:go-specific -_GO_XTEST_SRCS_VALUE= +_GO_XTEST_SRCS_VALUE= ### @usage: GO_XTEST_SRCS(Files...) ### .go sources for external tests of a module -macro GO_XTEST_SRCS(FILES...) { +macro GO_XTEST_SRCS(FILES...) { GO_FAKE_OUTPUT($FILES) - SET_APPEND(_GO_XTEST_SRCS_VALUE $FILES) -} - + SET_APPEND(_GO_XTEST_SRCS_VALUE $FILES) +} + # tag:go-specific macro _GO_UNUSED_SRCS(FLAGS...) { - ENABLE(UNUSED_MACRO) -} - + ENABLE(UNUSED_MACRO) +} + # tag:go-specific -_CGO_SRCS_VALUE= +_CGO_SRCS_VALUE= ### @usage: CGO_SRCS(Files...) ### .go sources to be built with CGO -macro CGO_SRCS(FILES...) { - SET_APPEND(_CGO_SRCS_VALUE $FILES) - PEERDIR(${GOSTD}/syscall) -} - +macro CGO_SRCS(FILES...) { + SET_APPEND(_CGO_SRCS_VALUE $FILES) + PEERDIR(${GOSTD}/syscall) +} + # tag:go-specific -GO_LDFLAGS_GLOBAL= +GO_LDFLAGS_GLOBAL= ### @usage: GO_LDFLAGS(Flags...) ### Link flags for GO_PROGRAM linking from .go sources -macro GO_LDFLAGS(FLAGS...) { - SET_APPEND(GO_LDFLAGS_GLOBAL $FLAGS) -} - +macro GO_LDFLAGS(FLAGS...) { + SET_APPEND(GO_LDFLAGS_GLOBAL $FLAGS) +} + # tag:go-specific -CGO_CFLAGS_VALUE= +CGO_CFLAGS_VALUE= ### @usage: CGO_CFLAGS(Flags...) ### Compiler flags specific to CGO compilation -macro CGO_CFLAGS(FLAGS...) { - SET_APPEND(CGO_CFLAGS_VALUE $FLAGS) - CFLAGS($FLAGS) -} - +macro CGO_CFLAGS(FLAGS...) { + SET_APPEND(CGO_CFLAGS_VALUE $FLAGS) + CFLAGS($FLAGS) +} + # tag:go-specific -CGO_LDFLAGS_VALUE= +CGO_LDFLAGS_VALUE= ### @usage: CGO_LDFLAGS(Files...) ### Linker flags specific to CGO linking -macro CGO_LDFLAGS(FLAGS...) { - SET_APPEND(CGO_LDFLAGS_VALUE $FLAGS) - GO_LDFLAGS($FLAGS) -} - +macro CGO_LDFLAGS(FLAGS...) { + SET_APPEND(CGO_LDFLAGS_VALUE $FLAGS) + GO_LDFLAGS($FLAGS) +} + # tag:go-specific -_GO_SKIP_TEST_VALUE= -### @usage: GO_SKIP_TESTS(TestNames...) -### -### Define a set of tests that should not be run. -### NB! Subtests are not taken into account! -macro GO_SKIP_TESTS(TESTS...) { - SET_APPEND(_GO_SKIP_TEST_VALUE $TESTS) - RESTRICT_PATH(vendor MSG This macro is prohibited to be used outside the vendor/ directory) -} - +_GO_SKIP_TEST_VALUE= +### @usage: GO_SKIP_TESTS(TestNames...) +### +### Define a set of tests that should not be run. +### NB! Subtests are not taken into account! +macro GO_SKIP_TESTS(TESTS...) { + SET_APPEND(_GO_SKIP_TEST_VALUE $TESTS) + RESTRICT_PATH(vendor MSG This macro is prohibited to be used outside the vendor/ directory) +} + # tag:go-specific tag:internal -_GO_EMBED_VALUE= -_GO_EMBED_INPUTS= -### @usage: _GO_EMBED_PATTERN(PATTERN) # internal -### -### Define an embed pattern. -macro _GO_EMBED_PATTERN(XTEST?"_xtest":"", PATTERN, IMPORT_PATH) { - SET(VAR_SALT1 $XTEST $PATTERN $IMPORT_PATH 1) - SET(_PATTERN_GLOB1 uniq_embed_${hash:VAR_SALT1}) - _GLOB($_PATTERN_GLOB1 ${ARCADIA_ROOT}/${IMPORT_PATH}/${PATTERN}/**/* EXCLUDE ${ARCADIA_ROOT}/${IMPORT_PATH}/${PATTERN}/**/_* ${ARCADIA_ROOT}/${IMPORT_PATH}/${PATTERN}/**/.*) - SET(VAR_SALT2 $XTEST $PATTERN $IMPORT_PATH 2) - SET(_PATTERN_GLOB2 _uniq_embed_${hash:VAR_SALT2}) - _GLOB($_PATTERN_GLOB2 ${ARCADIA_ROOT}/${IMPORT_PATH}/${PATTERN}) - SET_APPEND(_GO_EMBED_VALUE ++embed$XTEST $PATTERN \$$_PATTERN_GLOB1 \$$_PATTERN_GLOB2) - SET_APPEND(_GO_EMBED_INPUTS \$$_PATTERN_GLOB1 \$$_PATTERN_GLOB2) -} - +_GO_EMBED_VALUE= +_GO_EMBED_INPUTS= +### @usage: _GO_EMBED_PATTERN(PATTERN) # internal +### +### Define an embed pattern. +macro _GO_EMBED_PATTERN(XTEST?"_xtest":"", PATTERN, IMPORT_PATH) { + SET(VAR_SALT1 $XTEST $PATTERN $IMPORT_PATH 1) + SET(_PATTERN_GLOB1 uniq_embed_${hash:VAR_SALT1}) + _GLOB($_PATTERN_GLOB1 ${ARCADIA_ROOT}/${IMPORT_PATH}/${PATTERN}/**/* EXCLUDE ${ARCADIA_ROOT}/${IMPORT_PATH}/${PATTERN}/**/_* ${ARCADIA_ROOT}/${IMPORT_PATH}/${PATTERN}/**/.*) + SET(VAR_SALT2 $XTEST $PATTERN $IMPORT_PATH 2) + SET(_PATTERN_GLOB2 _uniq_embed_${hash:VAR_SALT2}) + _GLOB($_PATTERN_GLOB2 ${ARCADIA_ROOT}/${IMPORT_PATH}/${PATTERN}) + SET_APPEND(_GO_EMBED_VALUE ++embed$XTEST $PATTERN \$$_PATTERN_GLOB1 \$$_PATTERN_GLOB2) + SET_APPEND(_GO_EMBED_INPUTS \$$_PATTERN_GLOB1 \$$_PATTERN_GLOB2) +} + # tag:go-specific -### @usage: GO_EMBED_PATTERN(PATTERN) -### -### Define an embed pattern. -macro GO_EMBED_PATTERN(PATTERN) { - _GO_EMBED_PATTERN($PATTERN $_GO_IMPORT_PATH) -} - +### @usage: GO_EMBED_PATTERN(PATTERN) +### +### Define an embed pattern. +macro GO_EMBED_PATTERN(PATTERN) { + _GO_EMBED_PATTERN($PATTERN $_GO_IMPORT_PATH) +} + # tag:go-specific -### @usage: GO_TEST_EMBED_PATTERN(PATTERN) -### -### Define an embed pattern for internal go tests. -macro GO_TEST_EMBED_PATTERN(PATTERN) { - _GO_EMBED_PATTERN($PATTERN $_GO_IMPORT_PATH) -} - +### @usage: GO_TEST_EMBED_PATTERN(PATTERN) +### +### Define an embed pattern for internal go tests. +macro GO_TEST_EMBED_PATTERN(PATTERN) { + _GO_EMBED_PATTERN($PATTERN $_GO_IMPORT_PATH) +} + # tag:go-specific -### @usage: GO_XTEST_EMBED_PATTERN(PATTERN) -### -### Define an embed pattern for external go tests. -macro GO_XTEST_EMBED_PATTERN(PATTERN) { - _GO_EMBED_PATTERN(XTEST $PATTERN $_GO_IMPORT_PATH) -} - +### @usage: GO_XTEST_EMBED_PATTERN(PATTERN) +### +### Define an embed pattern for external go tests. +macro GO_XTEST_EMBED_PATTERN(PATTERN) { + _GO_EMBED_PATTERN(XTEST $PATTERN $_GO_IMPORT_PATH) +} + # tag:go-specific tag:internal -### @usage: _GO_EMBED_DIR(PATTERN) # internal -### -### Define an embed directory DIR. -macro _GO_EMBED_DIR(XTEST?"_xtest":"", DIR, IMPORT_PATH) { +### @usage: _GO_EMBED_DIR(PATTERN) # internal +### +### Define an embed directory DIR. +macro _GO_EMBED_DIR(XTEST?"_xtest":"", DIR, IMPORT_PATH) { SET(VAR_SALT $XTEST $DIR $IMPORT_PATH) SET(_PATTERN_GLOB uniq_embed_${hash:VAR_SALT}) - _GLOB($_PATTERN_GLOB ${ARCADIA_ROOT}/${IMPORT_PATH}/${DIR}/**/* EXCLUDE ${ARCADIA_ROOT}/${IMPORT_PATH}/${DIR}/**/_* ${ARCADIA_ROOT}/${IMPORT_PATH}/${DIR}/**/.*) - SET_APPEND(_GO_EMBED_VALUE ++embed$XTEST $DIR \$$_PATTERN_GLOB) - SET_APPEND(_GO_EMBED_INPUTS \$$_PATTERN_GLOB) -} - + _GLOB($_PATTERN_GLOB ${ARCADIA_ROOT}/${IMPORT_PATH}/${DIR}/**/* EXCLUDE ${ARCADIA_ROOT}/${IMPORT_PATH}/${DIR}/**/_* ${ARCADIA_ROOT}/${IMPORT_PATH}/${DIR}/**/.*) + SET_APPEND(_GO_EMBED_VALUE ++embed$XTEST $DIR \$$_PATTERN_GLOB) + SET_APPEND(_GO_EMBED_INPUTS \$$_PATTERN_GLOB) +} + # tag:go-specific -### @usage: GO_EMBED_DIR(DIR) -### -### Define an embed directory DIR. -macro GO_EMBED_DIR(DIR) { - _GO_EMBED_DIR($DIR $_GO_IMPORT_PATH) -} - +### @usage: GO_EMBED_DIR(DIR) +### +### Define an embed directory DIR. +macro GO_EMBED_DIR(DIR) { + _GO_EMBED_DIR($DIR $_GO_IMPORT_PATH) +} + # tag:go-specific -### @usage: GO_TEST_EMBED_DIR(DIR) -### -### Define an embed directory DIR for internal go tests. -macro GO_EMBED_TEST_DIR(DIR) { - _GO_EMBED_DIR($DIR $_GO_IMPORT_PATH) -} - +### @usage: GO_TEST_EMBED_DIR(DIR) +### +### Define an embed directory DIR for internal go tests. +macro GO_EMBED_TEST_DIR(DIR) { + _GO_EMBED_DIR($DIR $_GO_IMPORT_PATH) +} + # tag:go-specific -### @usage: GO_XTEST_EMBED_DIR(DIR) -### -### Define an embed directory DIR for external go tests. -macro GO_EMBED_XTEST_DIR(DIR) { - _GO_EMBED_DIR(XTEST $DIR $_GO_IMPORT_PATH) -} - +### @usage: GO_XTEST_EMBED_DIR(DIR) +### +### Define an embed directory DIR for external go tests. +macro GO_EMBED_XTEST_DIR(DIR) { + _GO_EMBED_DIR(XTEST $DIR $_GO_IMPORT_PATH) +} + # tag:go-specific -_GO_TOOLCHAIN_ENV_GOARCH=unknown -when ($ARCH_ARM64) { - _GO_TOOLCHAIN_ENV_GOARCH=${env:"GOARCH=arm64"} -} -elsewhen ($ARCH_X86_64) { - _GO_TOOLCHAIN_ENV_GOARCH=${env:"GOARCH=amd64"} -} - +_GO_TOOLCHAIN_ENV_GOARCH=unknown +when ($ARCH_ARM64) { + _GO_TOOLCHAIN_ENV_GOARCH=${env:"GOARCH=arm64"} +} +elsewhen ($ARCH_X86_64) { + _GO_TOOLCHAIN_ENV_GOARCH=${env:"GOARCH=amd64"} +} + # tag:go-specific -_GO_TOOLCHAIN_ENV_GOOS=unknown -when ($OS_DARWIN) { - _GO_TOOLCHAIN_ENV_GOOS=${env:"GOOS=darwin"} -} -elsewhen ($OS_LINUX) { - _GO_TOOLCHAIN_ENV_GOOS=${env:"GOOS=linux"} -} -elsewhen ($OS_WINDOWS) { - _GO_TOOLCHAIN_ENV_GOOS=${env:"GOOS=windows"} -} -_GO_TOOLCHAIN_ENV_PATH= - +_GO_TOOLCHAIN_ENV_GOOS=unknown +when ($OS_DARWIN) { + _GO_TOOLCHAIN_ENV_GOOS=${env:"GOOS=darwin"} +} +elsewhen ($OS_LINUX) { + _GO_TOOLCHAIN_ENV_GOOS=${env:"GOOS=linux"} +} +elsewhen ($OS_WINDOWS) { + _GO_TOOLCHAIN_ENV_GOOS=${env:"GOOS=windows"} +} +_GO_TOOLCHAIN_ENV_PATH= + # tag:go-specific -GO_TOOLCHAIN_ENV=$TOOLCHAIN_ENV $_GO_TOOLCHAIN_ENV_GOARCH $_GO_TOOLCHAIN_ENV_GOOS $_GO_TOOLCHAIN_ENV_PATH - +GO_TOOLCHAIN_ENV=$TOOLCHAIN_ENV $_GO_TOOLCHAIN_ENV_GOARCH $_GO_TOOLCHAIN_ENV_GOOS $_GO_TOOLCHAIN_ENV_PATH + # tag:go-specific -_GO_GRPC_WELLKNOWN=\ - vendor/google.golang.org/grpc \ - vendor/google.golang.org/grpc \ - vendor/google.golang.org/grpc/codes \ - vendor/google.golang.org/grpc/grpclog \ - vendor/google.golang.org/grpc/status - +_GO_GRPC_WELLKNOWN=\ + vendor/google.golang.org/grpc \ + vendor/google.golang.org/grpc \ + vendor/google.golang.org/grpc/codes \ + vendor/google.golang.org/grpc/grpclog \ + vendor/google.golang.org/grpc/status + # tag:go-specific macro _GO_GRPC() { - SET(GO_PROTO_GEN_PLUGINS grpc) - PEERDIR(${GOSTD}/context ${_GO_GRPC_WELLKNOWN}) -} - + SET(GO_PROTO_GEN_PLUGINS grpc) + PEERDIR(${GOSTD}/context ${_GO_GRPC_WELLKNOWN}) +} + # tag:go-specific ### @usage: GO_GRPC_GATEWAY_SRCS() -### -### Use of grpc-gateway plugin (Supported for Go only). -macro GO_GRPC_GATEWAY_SRCS(FILE...) { - ENABLE(UNUSED_MACRO) -} - +### +### Use of grpc-gateway plugin (Supported for Go only). +macro GO_GRPC_GATEWAY_SRCS(FILE...) { + ENABLE(UNUSED_MACRO) +} + # tag:go-specific ### @usage: GO_GRPC_GATEWAY_SWAGGER_SRCS() ### @@ -8315,22 +8315,22 @@ macro GO_GRPC_GATEWAY_SWAGGER_SRCS(FILE...) { } # tag:go-specific -_GO_PROTO_GRPC_GATEWAY_OPTS= -_GO_PROTO_GRPC_GATEWAY_OUTS= - +_GO_PROTO_GRPC_GATEWAY_OPTS= +_GO_PROTO_GRPC_GATEWAY_OUTS= + # tag:go-specific macro _GO_GRPC_GATEWAY_SRCS_IMPL(Files...) { - foreach (File : $Files) { + foreach (File : $Files) { [.proto]=$_GO_PROTO_CMD_IMPL($File OPTS $_GO_PROTO_GRPC_GATEWAY_OPTS OUTS $_GO_PROTO_GRPC_GATEWAY_OUTS) - } - - PEERDIR(${GOSTD}/context ${GOSTD}/io ${GOSTD}/net/http) + } + + PEERDIR(${GOSTD}/context ${GOSTD}/io ${GOSTD}/net/http) PEERDIR(vendor/github.com/golang/protobuf/descriptor) - PEERDIR(vendor/github.com/grpc-ecosystem/grpc-gateway/runtime) - PEERDIR(vendor/github.com/grpc-ecosystem/grpc-gateway/utilities) + PEERDIR(vendor/github.com/grpc-ecosystem/grpc-gateway/runtime) + PEERDIR(vendor/github.com/grpc-ecosystem/grpc-gateway/utilities) PEERDIR(vendor/google.golang.org/grpc/metadata) -} - +} + # tag:go-specific macro _SETUP_GO_GRPC_GATEWAY() { SET(_GO_PROTO_GRPC_GATEWAY_OPTS $_PROTO_PLUGIN_ARGS_BASE(go_grpc_gw vendor/github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway allow_repeated_fields_in_body=true:)) @@ -8354,175 +8354,175 @@ macro _GO_GRPC_GATEWAY_SWAGGER_SRCS(Files...) { } # tag:go-specific -when ($MUSL == "yes") { - _GO_DEFAULT_ALLOCATOR=$DEFAULT_ALLOCATOR -} -otherwise { - _GO_DEFAULT_ALLOCATOR=FAKE -} +when ($MUSL == "yes") { + _GO_DEFAULT_ALLOCATOR=$DEFAULT_ALLOCATOR +} +otherwise { + _GO_DEFAULT_ALLOCATOR=FAKE +} # tag:go-specific tag:internal ### @usage _GO_BASE_UNIT # internal ### ### The base module of all golang modules. Defines common properties, dependencies and rules for go build. module _GO_BASE_UNIT: _BASE_UNIT { - .EXTS=.go .gosrc .o .obj .a .symabis .mf - .CMD=TOUCH_UNIT - .NODE_TYPE=Bundle - .GLOBAL=GO_LDFLAGS - .PEERDIR_POLICY=as_build_from - .ALIASES=SRCS=_GO_SRCS RESOURCE=_GO_RESOURCE GO_TEST_SRCS=_GO_UNUSED_SRCS GO_XTEST_SRCS=_GO_UNUSED_SRCS GRPC=_GO_GRPC GO_GRPC_GATEWAY_SRCS=_GO_GRPC_GATEWAY_SRCS GO_GRPC_GATEWAY_SWAGGER_SRCS=_GO_GRPC_GATEWAY_SWAGGER_SRCS CFLAGS=CGO_CFLAGS GO_TEST_EMBED_PATTERN=_GO_UNUSED_SRCS GO_XTEST_EMBED_PATTERN=_GO_UNUSED_SRCS GO_TEST_EMBED_DIR=_GO_UNUSED_SRCS GO_XTEST_EMBED_DIR=_GO_UNUSED_SRCS + .EXTS=.go .gosrc .o .obj .a .symabis .mf + .CMD=TOUCH_UNIT + .NODE_TYPE=Bundle + .GLOBAL=GO_LDFLAGS + .PEERDIR_POLICY=as_build_from + .ALIASES=SRCS=_GO_SRCS RESOURCE=_GO_RESOURCE GO_TEST_SRCS=_GO_UNUSED_SRCS GO_XTEST_SRCS=_GO_UNUSED_SRCS GRPC=_GO_GRPC GO_GRPC_GATEWAY_SRCS=_GO_GRPC_GATEWAY_SRCS GO_GRPC_GATEWAY_SWAGGER_SRCS=_GO_GRPC_GATEWAY_SWAGGER_SRCS CFLAGS=CGO_CFLAGS GO_TEST_EMBED_PATTERN=_GO_UNUSED_SRCS GO_XTEST_EMBED_PATTERN=_GO_UNUSED_SRCS GO_TEST_EMBED_DIR=_GO_UNUSED_SRCS GO_XTEST_EMBED_DIR=_GO_UNUSED_SRCS .ALLOWED=GO_PROTO_PLUGIN USE_CXX USE_UTIL RESOURCE_FILES .IGNORED=GO_SKIP_TESTS USE_SKIFF - - ENABLE(_GO_MODULE) - SET(MODULE_TAG GO) - PEERDIR_TAGS=GO GO_PROTO GO_FBS __EMPTY__ - DEFAULT(_GO_VET_TOOL) - DEFAULT(_GO_VET_FLAGS) - DEFAULT(_GO_VET_EXTS) - DEFAULT(_GO_SONAME) - - NO_RUNTIME() - - SET(COVERAGE_FLAGS) - SET(EXTRA_OUTPUT) + + ENABLE(_GO_MODULE) + SET(MODULE_TAG GO) + PEERDIR_TAGS=GO GO_PROTO GO_FBS __EMPTY__ + DEFAULT(_GO_VET_TOOL) + DEFAULT(_GO_VET_FLAGS) + DEFAULT(_GO_VET_EXTS) + DEFAULT(_GO_SONAME) + + NO_RUNTIME() + + SET(COVERAGE_FLAGS) + SET(EXTRA_OUTPUT) SET(MODULE_LANG GO) - - PEERDIR(build/external_resources/go_tools) - - GO_PROTO_OUTS+=${output;hide;norel;nopath;noext;suf=.pb.go:File} - - when ($COMPILER_PLATFORM && $NEED_PLATFORM_PEERDIRS == "yes") { - PEERDIR+=$COMPILER_PLATFORM - } - - when ($CLANG == "yes" || $GCC == "yes") { - CGO_CFLAGS_VALUE += -w -pthread -fpic - CGO2_CFLAGS_VALUE += -Wno-unused-variable - } - - select ($GO_VET) { - "yes" | "on" ? { - _GO_VET=yes - _GO_VET_FLAGS+=-cgocall=false - } - "yndexer" ? { - _GO_VET=yes - PEERDIR+=build/external_resources/goyndexer - _GO_VET_TOOL=${GOYNDEXER_RESOURCE_GLOBAL}/goyndexer - _GO_YDX_FILE=++ydx-file ${_GO_YNDEXER_EXT} - _GO_VET_FLAGS=-indexer.arc ${ARCADIA_ROOT} -indexer.indexfile ${GO_YNDEXER_OUTPUT} -indexer.loglevel info - _GO_FMT_ADD_CHECK=no - _GO_VET_ADD_CHECK=no - GO_VET_INFO_EXT=.ydx.out - GO_VET_REPORT_EXT=.ydx.txt - _GO_VET_EXTS=++vet-info-ext .ydx.out ++vet-report-ext .ydx.txt - _GO_CGO1_WRAPPER_FLAGS=--build-prefix=__ARCADIA_BUILD_ROOT_PREFIX__ --source-prefix=__ARCADIA_SOURCE_ROOT_PREFIX__ - } - "yolint" ? { - _GO_VET=yes - PEERDIR+=build/external_resources/yolint - _GO_VET_TOOL=${YOLINT_RESOURCE_GLOBAL}/yolint + + PEERDIR(build/external_resources/go_tools) + + GO_PROTO_OUTS+=${output;hide;norel;nopath;noext;suf=.pb.go:File} + + when ($COMPILER_PLATFORM && $NEED_PLATFORM_PEERDIRS == "yes") { + PEERDIR+=$COMPILER_PLATFORM + } + + when ($CLANG == "yes" || $GCC == "yes") { + CGO_CFLAGS_VALUE += -w -pthread -fpic + CGO2_CFLAGS_VALUE += -Wno-unused-variable + } + + select ($GO_VET) { + "yes" | "on" ? { + _GO_VET=yes + _GO_VET_FLAGS+=-cgocall=false + } + "yndexer" ? { + _GO_VET=yes + PEERDIR+=build/external_resources/goyndexer + _GO_VET_TOOL=${GOYNDEXER_RESOURCE_GLOBAL}/goyndexer + _GO_YDX_FILE=++ydx-file ${_GO_YNDEXER_EXT} + _GO_VET_FLAGS=-indexer.arc ${ARCADIA_ROOT} -indexer.indexfile ${GO_YNDEXER_OUTPUT} -indexer.loglevel info + _GO_FMT_ADD_CHECK=no + _GO_VET_ADD_CHECK=no + GO_VET_INFO_EXT=.ydx.out + GO_VET_REPORT_EXT=.ydx.txt + _GO_VET_EXTS=++vet-info-ext .ydx.out ++vet-report-ext .ydx.txt + _GO_CGO1_WRAPPER_FLAGS=--build-prefix=__ARCADIA_BUILD_ROOT_PREFIX__ --source-prefix=__ARCADIA_SOURCE_ROOT_PREFIX__ + } + "yolint" ? { + _GO_VET=yes + PEERDIR+=build/external_resources/yolint + _GO_VET_TOOL=${YOLINT_RESOURCE_GLOBAL}/yolint _GO_VET_FLAGS=-migration.config=${input:"${ARCADIA_ROOT}/build/rules/go/migrations.yaml"} -importcheck=false -SA1019=false -copyproto=false -bodyclose=false -rowserrcheck=false -ytcheck=false - } - "yolint_next" ? { - _GO_VET=yes - PEERDIR+=build/external_resources/yolint - _GO_VET_TOOL=${YOLINT_NEXT_RESOURCE_GLOBAL}/yolint + } + "yolint_next" ? { + _GO_VET=yes + PEERDIR+=build/external_resources/yolint + _GO_VET_TOOL=${YOLINT_NEXT_RESOURCE_GLOBAL}/yolint _GO_VET_FLAGS=-copyproto=false - } + } "local" ? { _GO_VET=yes _GO_VET_FLAGS= } - default ? { - _GO_VET=no - _GO_VET_FLAGS= - } - } - SET(_GO_VET $_GO_VET) - - when ($GO_VET_TOOL == "") { - _GO_VET_TOOL_REAL=$_GO_VET_TOOL - } - otherwise { - _GO_VET_TOOL_REAL=$GO_VET_TOOL - } - - when ($GO_VET_FLAGS == "") { - _GO_VET_FLAGS_REAL=$_GO_VET_FLAGS - } - otherwise { - _GO_VET_FLAGS_REAL=$GO_VET_FLAGS - } - - when ($_GO_VET == "yes" && $NO_GO_VET != "yes") { - GO_VET_OUTPUT=++vet $_GO_VET_TOOL_REAL ++vet-flags $_GO_VET_FLAGS_REAL $GO_VET_EXTRA_FLAGS $GO_VET_OUTPUT_INFO $GO_VET_OUTPUT_REPORT $_GO_VET_EXTS - } - otherwise { - GO_VET_OUTPUT= - _GO_VET_ADD_CHECK=no - } - - when ($GO_DEBUG_PATH_RELATIVE == "yes") { - _GO_DEBUG_PATH__NO_UID__=++debug-root-map source=;build=;tools= ++tools-root $(TOOL_ROOT) - _GO_COMPILE_SYMABIS_TRIMPATH__NO_UID__=-trimpath $ARCADIA_ROOT=>;$ARCADIA_BUILD_ROOT=>;$(TOOL_ROOT)=> - } - otherwise { - _GO_DEBUG_PATH__NO_UID__=++debug-root-map source=/-S;build=/-B;tools=/-T ++tools-root $(TOOL_ROOT) - _GO_COMPILE_SYMABIS_TRIMPATH__NO_UID__=-trimpath $ARCADIA_ROOT=>/-S;$ARCADIA_BUILD_ROOT=>/-B;$(TOOL_ROOT)=>/-T - } - - _GO_PROCESS_SRCS() - - when ($CLANG == "yes") { - _GO_EXTLD=clang - GO_TOOLCHAIN_ENV += ${env:"CC=clang"} - } - otherwise { - _GO_EXTLD=gcc - GO_TOOLCHAIN_ENV += ${env:"CC=gcc"} - } - - when ($OS_DARWIN) { - PEERDIR+=build/external_resources/go_fake_xcrun + default ? { + _GO_VET=no + _GO_VET_FLAGS= + } + } + SET(_GO_VET $_GO_VET) + + when ($GO_VET_TOOL == "") { + _GO_VET_TOOL_REAL=$_GO_VET_TOOL + } + otherwise { + _GO_VET_TOOL_REAL=$GO_VET_TOOL + } + + when ($GO_VET_FLAGS == "") { + _GO_VET_FLAGS_REAL=$_GO_VET_FLAGS + } + otherwise { + _GO_VET_FLAGS_REAL=$GO_VET_FLAGS + } + + when ($_GO_VET == "yes" && $NO_GO_VET != "yes") { + GO_VET_OUTPUT=++vet $_GO_VET_TOOL_REAL ++vet-flags $_GO_VET_FLAGS_REAL $GO_VET_EXTRA_FLAGS $GO_VET_OUTPUT_INFO $GO_VET_OUTPUT_REPORT $_GO_VET_EXTS + } + otherwise { + GO_VET_OUTPUT= + _GO_VET_ADD_CHECK=no + } + + when ($GO_DEBUG_PATH_RELATIVE == "yes") { + _GO_DEBUG_PATH__NO_UID__=++debug-root-map source=;build=;tools= ++tools-root $(TOOL_ROOT) + _GO_COMPILE_SYMABIS_TRIMPATH__NO_UID__=-trimpath $ARCADIA_ROOT=>;$ARCADIA_BUILD_ROOT=>;$(TOOL_ROOT)=> + } + otherwise { + _GO_DEBUG_PATH__NO_UID__=++debug-root-map source=/-S;build=/-B;tools=/-T ++tools-root $(TOOL_ROOT) + _GO_COMPILE_SYMABIS_TRIMPATH__NO_UID__=-trimpath $ARCADIA_ROOT=>/-S;$ARCADIA_BUILD_ROOT=>/-B;$(TOOL_ROOT)=>/-T + } + + _GO_PROCESS_SRCS() + + when ($CLANG == "yes") { + _GO_EXTLD=clang + GO_TOOLCHAIN_ENV += ${env:"CC=clang"} + } + otherwise { + _GO_EXTLD=gcc + GO_TOOLCHAIN_ENV += ${env:"CC=gcc"} + } + + when ($OS_DARWIN) { + PEERDIR+=build/external_resources/go_fake_xcrun GO_EXTLD = ++extld $_GO_EXTLD ++extldflags $_GO_SONAME $LD_SDK_VERSION -undefined dynamic_lookup $C_FLAGS_PLATFORM --sysroot=$MACOS_SDK_RESOURCE_GLOBAL --start-wa ${rootrel;ext=.a:SRCS_GLOBAL} --end-wa ${rootrel;ext=.o:SRCS_GLOBAL} --cgo-peers $LDFLAGS $LDFLAGS_GLOBAL $OBJADDE $OBJADDE_LIB $GO_LDFLAGS_GLOBAL $C_LIBRARY_PATH $C_SYSTEM_LIBRARIES_INTERCEPT $C_SYSTEM_LIBRARIES $STRIP_FLAG - CGO2_LDFLAGS_VALUE += $LD_SDK_VERSION -undefined dynamic_lookup -nodefaultlibs -lc - } - elsewhen ($OS_LINUX) { + CGO2_LDFLAGS_VALUE += $LD_SDK_VERSION -undefined dynamic_lookup -nodefaultlibs -lc + } + elsewhen ($OS_LINUX) { GO_EXTLD = ++extld $_GO_EXTLD ++extldflags $_GO_SONAME $C_FLAGS_PLATFORM --sysroot=$OS_SDK_ROOT_RESOURCE_GLOBAL -Wl,--whole-archive ${rootrel;ext=.a:SRCS_GLOBAL} -Wl,--no-whole-archive ${rootrel;ext=.o:SRCS_GLOBAL} --cgo-peers $LDFLAGS $LDFLAGS_GLOBAL $OBJADDE $OBJADDE_LIB $GO_LDFLAGS_GLOBAL $C_LIBRARY_PATH $C_SYSTEM_LIBRARIES_INTERCEPT $C_SYSTEM_LIBRARIES $STRIP_FLAG - CGO2_LDFLAGS_VALUE += -Wl,--unresolved-symbols=ignore-all -nodefaultlibs -lc - } - otherwise { - GO_EXTLD = ++extld $_GO_EXTLD - } - - when ($RACE == "yes") { - _GO_COMPILE_FLAGS_RACE=-race - _GO_LINK_FLAGS_RACE=-race - } - otherwise { - _GO_COMPILE_FLAGS_RACE= - _GO_LINK_FLAGS_RACE= - } - - when ($PIC == "yes") { - _GO_COMPILE_FLAGS_SHARED=-shared - _GO_ASM_FLAGS_SHARED=-shared - } - otherwise { - _GO_COMPILE_FLAGS_SHARED= - _GO_ASM_FLAGS_SHARED= - } - - GO_ASM_FLAGS_VALUE += $_GO_ASM_FLAGS_SHARED - GO_COMPILE_FLAGS_VALUE += $_GO_COMPILE_FLAGS_RACE $_GO_COMPILE_FLAGS_SHARED - GO_LINK_FLAGS_VALUE += $_GO_LINK_FLAGS_RACE - - ADDINCL(${GOSTD}/runtime) -} - + CGO2_LDFLAGS_VALUE += -Wl,--unresolved-symbols=ignore-all -nodefaultlibs -lc + } + otherwise { + GO_EXTLD = ++extld $_GO_EXTLD + } + + when ($RACE == "yes") { + _GO_COMPILE_FLAGS_RACE=-race + _GO_LINK_FLAGS_RACE=-race + } + otherwise { + _GO_COMPILE_FLAGS_RACE= + _GO_LINK_FLAGS_RACE= + } + + when ($PIC == "yes") { + _GO_COMPILE_FLAGS_SHARED=-shared + _GO_ASM_FLAGS_SHARED=-shared + } + otherwise { + _GO_COMPILE_FLAGS_SHARED= + _GO_ASM_FLAGS_SHARED= + } + + GO_ASM_FLAGS_VALUE += $_GO_ASM_FLAGS_SHARED + GO_COMPILE_FLAGS_VALUE += $_GO_COMPILE_FLAGS_RACE $_GO_COMPILE_FLAGS_SHARED + GO_LINK_FLAGS_VALUE += $_GO_LINK_FLAGS_RACE + + ADDINCL(${GOSTD}/runtime) +} + # tag:go-specific ### @usage: GO_LIBRARY([name]) ### @@ -8530,17 +8530,17 @@ module _GO_BASE_UNIT: _BASE_UNIT { ### Compile Go module as a library suitable for PEERDIR from other Go modules. ### Will select Go implementation on PEERDIR to PROTO_LIBRARY. module GO_LIBRARY: _GO_BASE_UNIT { - .CMD=GO_LINK_LIB - .NODE_TYPE=Bundle + .CMD=GO_LINK_LIB + .NODE_TYPE=Bundle .FINAL_TARGET=no .ALIASES=GO_REQUIREMENTS=LIB_REQUIREMENTS - SET(_GO_TOOL_MODE lib) - SET(MODULE_TYPE LIBRARY) + SET(_GO_TOOL_MODE lib) + SET(MODULE_TYPE LIBRARY) _REQUIRE_EXPLICIT_LICENSE(vendor) - - MODULE_SUFFIX=.a -} - + + MODULE_SUFFIX=.a +} + # tag:go-specific ### @usage: GO_PROGRAM([name]) ### @@ -8548,87 +8548,87 @@ module GO_LIBRARY: _GO_BASE_UNIT { ### Compile and link Go module to an executable program. ### Will select Go implementation on PEERDIR to PROTO_LIBRARY. module GO_PROGRAM: _GO_BASE_UNIT { - .CMD=GO_LINK_EXE - .NODE_TYPE=Bundle - .SYMLINK_POLICY=EXE + .CMD=GO_LINK_EXE + .NODE_TYPE=Bundle + .SYMLINK_POLICY=EXE .ALLOWED=INDUCED_DEPS .FINAL_TARGET=yes .ALIASES=GO_REQUIREMENTS=LD_REQUIREMENTS - SET(_GO_TOOL_MODE exe) - SET(MODULE_TYPE PROGRAM) - SET(GO_VET_OUTPUT_INFO) - - ALLOCATOR($_GO_DEFAULT_ALLOCATOR) - + SET(_GO_TOOL_MODE exe) + SET(MODULE_TYPE PROGRAM) + SET(GO_VET_OUTPUT_INFO) + + ALLOCATOR($_GO_DEFAULT_ALLOCATOR) + _USE_LINKER() - - ENABLE(COMMON_LINK_SETTINGS) - - when ($MUSL == "yes") { + + ENABLE(COMMON_LINK_SETTINGS) + + when ($MUSL == "yes") { PEERDIR += contrib/libs/musl/full - } - - when ($MSVC == "yes" || $CYGWIN == "yes") { - MODULE_SUFFIX=.exe - } - - PEERDIR(${GOSTD}/runtime library/go/core/buildinfo) - - when ($RACE == "yes") { - PEERDIR += ${GOSTD}/runtime/cgo - PEERDIR += ${GOSTD}/runtime/race - } - - when ($MUSL == "yes") { - GO_WITH_MUSL = ++musl - } -} - + } + + when ($MSVC == "yes" || $CYGWIN == "yes") { + MODULE_SUFFIX=.exe + } + + PEERDIR(${GOSTD}/runtime library/go/core/buildinfo) + + when ($RACE == "yes") { + PEERDIR += ${GOSTD}/runtime/cgo + PEERDIR += ${GOSTD}/runtime/race + } + + when ($MUSL == "yes") { + GO_WITH_MUSL = ++musl + } +} + # tag:go-specific -module _GO_DLL_BASE_UNIT: GO_PROGRAM { - .CMD=GO_LINK_DLL - .SYMLINK_POLICY=SO - .ALLOWED=WHOLE_ARCHIVE - SET(_GO_TOOL_MODE dll) - SET(MODULE_TYPE DLL) - - GO_PACKAGE_NAME(main) - - when ($MSVC == "yes" || $CYGWIN == "yes") { - MODULE_SUFFIX=.dll - } - elsewhen ($DARWIN == "yes" || $OS_IOS == "yes") { - MODULE_PREFIX=lib - MODULE_SUFFIX=.dylib$MODULE_VERSION - } - otherwise { - MODULE_PREFIX=lib - MODULE_SUFFIX=.so$MODULE_VERSION - } - - when ($OS_DARWIN) { - _GO_SONAME=-Wl,-install_name,$SONAME - } - elsewhen ($OS_LINUX) { - _GO_SONAME=-Wl,-soname,$SONAME - } - - when ($MODULE_VERSION) { - when ($OS_LINUX || $OS_DARWIN) { - _GO_LINK_EXE_EXT_CMD+= && $LINK_OR_COPY_CMD $TARGET ${output;nopath;noext:SONAME} - } - } -} - +module _GO_DLL_BASE_UNIT: GO_PROGRAM { + .CMD=GO_LINK_DLL + .SYMLINK_POLICY=SO + .ALLOWED=WHOLE_ARCHIVE + SET(_GO_TOOL_MODE dll) + SET(MODULE_TYPE DLL) + + GO_PACKAGE_NAME(main) + + when ($MSVC == "yes" || $CYGWIN == "yes") { + MODULE_SUFFIX=.dll + } + elsewhen ($DARWIN == "yes" || $OS_IOS == "yes") { + MODULE_PREFIX=lib + MODULE_SUFFIX=.dylib$MODULE_VERSION + } + otherwise { + MODULE_PREFIX=lib + MODULE_SUFFIX=.so$MODULE_VERSION + } + + when ($OS_DARWIN) { + _GO_SONAME=-Wl,-install_name,$SONAME + } + elsewhen ($OS_LINUX) { + _GO_SONAME=-Wl,-soname,$SONAME + } + + when ($MODULE_VERSION) { + when ($OS_LINUX || $OS_DARWIN) { + _GO_LINK_EXE_EXT_CMD+= && $LINK_OR_COPY_CMD $TARGET ${output;nopath;noext:SONAME} + } + } +} + # tag:go-specific -### @usage: GO_DLL(name major_ver [minor_ver] [PREFIX prefix]) -### -### Go ishared object module definition. -### Compile and link Go module to a shared object. -### Will select Go implementation on PEERDIR to PROTO_LIBRARY. -module GO_DLL: _GO_DLL_BASE_UNIT { -} - +### @usage: GO_DLL(name major_ver [minor_ver] [PREFIX prefix]) +### +### Go ishared object module definition. +### Compile and link Go module to a shared object. +### Will select Go implementation on PEERDIR to PROTO_LIBRARY. +module GO_DLL: _GO_DLL_BASE_UNIT { +} + # tag:go-specific tag:test ### @usage: GO_BENCH_TIMEOUT(x) ### @@ -8646,29 +8646,29 @@ macro GO_BENCH_TIMEOUT(bench_timeout) { ### Compile and link Go module as a test suitable for running with Arcadia testing support. ### All usual testing support macros like DATA, DEPENDS, SIZE, REQUIREMENTS etc. are supported. ### Will select Go implementation on PEERDIR to PROTO_LIBRARY. -module GO_TEST: GO_PROGRAM { - .CMD=GO_LINK_TEST - .ALIASES=GO_TEST_SRCS=GO_TEST_SRCS GO_XTEST_SRCS=GO_XTEST_SRCS GO_TEST_EMBED_PATTERN=GO_TEST_EMBED_PATTERN GO_XTEST_EMBED_PATTERN=GO_XTEST_EMBED_PATTERN GO_TEST_EMBED_DIR=GO_TEST_EMBED_DIR GO_XTEST_EMBED_DIR=GO_XTEST_EMBED_DIR - .ALLOWED=GO_SKIP_TESTS YT_SPEC +module GO_TEST: GO_PROGRAM { + .CMD=GO_LINK_TEST + .ALIASES=GO_TEST_SRCS=GO_TEST_SRCS GO_XTEST_SRCS=GO_XTEST_SRCS GO_TEST_EMBED_PATTERN=GO_TEST_EMBED_PATTERN GO_XTEST_EMBED_PATTERN=GO_XTEST_EMBED_PATTERN GO_TEST_EMBED_DIR=GO_TEST_EMBED_DIR GO_XTEST_EMBED_DIR=GO_XTEST_EMBED_DIR + .ALLOWED=GO_SKIP_TESTS YT_SPEC .FINAL_TARGET=no - SET(_GO_TOOL_MODE test) - SET(MODULE_TYPE PROGRAM) - ENABLE(GO_TEST_MODULE) - SET(GO_COVER_INFO_VALUE) - - # We have to add uncoditionaly PEERDIR to ${GOSTD}/os here thouth it is really - # needed when TestMain is defined in the source code of the test - PEERDIR(${GOSTD}/os) - - PEERDIR(${GOSTD}/testing/internal/testdeps) - PEERDIR(${GOSTD}/testing) - + SET(_GO_TOOL_MODE test) + SET(MODULE_TYPE PROGRAM) + ENABLE(GO_TEST_MODULE) + SET(GO_COVER_INFO_VALUE) + + # We have to add uncoditionaly PEERDIR to ${GOSTD}/os here thouth it is really + # needed when TestMain is defined in the source code of the test + PEERDIR(${GOSTD}/os) + + PEERDIR(${GOSTD}/testing/internal/testdeps) + PEERDIR(${GOSTD}/testing) + ADD_YTEST($MODULE_PREFIX$REALPRJNAME go.test) ADD_YTEST($MODULE_PREFIX$REALPRJNAME go.bench) SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS canondata/result.json) -} - +} + # tag:go-specific macro GO_MOCKGEN_FROM(Path) { SET(MOCKGEN_FROM ${Path}) @@ -8769,15 +8769,15 @@ macro ALL_PY_SRCS(TOP_LEVEL?"TOP_LEVEL":"", NAMESPACE="", RECURSIVE?"RECURSIVE": } # tag:python-specific -_PY_EXTRA_LINT_FILES_VALUE= -### @usage: PY_EXTRA_LINT_FILES(files...) -### -### Add extra Python files for linting. This macro allows adding -### Python files which has no .py extension. -macro PY_EXTRA_LINT_FILES(FILES...) { - SET_APPEND(_PY_EXTRA_LINT_FILES_VALUE $FILES) -} - +_PY_EXTRA_LINT_FILES_VALUE= +### @usage: PY_EXTRA_LINT_FILES(files...) +### +### Add extra Python files for linting. This macro allows adding +### Python files which has no .py extension. +macro PY_EXTRA_LINT_FILES(FILES...) { + SET_APPEND(_PY_EXTRA_LINT_FILES_VALUE $FILES) +} + # tag:python-specific ### @usage: PY23_LIBRARY([name]) ### @@ -9005,8 +9005,8 @@ when (!$TENSORRT_VERSION) { ANDROID_APK_TEST_ACTIVITY_VALUE=com.yandex.test.unittests/.RunTestsActivity -MAVEN_BIN=$MAVEN_RESOURCE_GLOBAL/bin - +MAVEN_BIN=$MAVEN_RESOURCE_GLOBAL/bin + when ($QT_REQUIRED) { QT_BIN=${HOST_QT_RESOURCE_GLOBAL}/bin } @@ -9046,33 +9046,33 @@ macro WINDOWS_MANIFEST(Manifest) { when ($MSVC == "yes" && $WINDOWS_MANIFEST) { LDFLAGS+=/MANIFEST:EMBED /MANIFESTINPUT:${input:WINDOWS_MANIFEST} } - + # tag:cpp-specific -_VISIBILITY_LEVEL= -### @usage: VISIBILITY(level) -### -### This macro sets visibility level for symbols compiled for the current module. 'level' -### may take only one of the following values: DEFAULT, HIDDEN. -macro VISIBILITY(LEVEL) { - SET(_VISIBILITY_LEVEL ${LEVEL}) - select ($LEVEL) { - "DEFAULT" | "HIDDEN" ? { - } - default ? { - _OK = no - } - } - ASSERT(_OK Unsupported value [$LEVEL] passed to VISIBILITY macro, expected values are DEFAULT, HIDDEN.) -} - +_VISIBILITY_LEVEL= +### @usage: VISIBILITY(level) +### +### This macro sets visibility level for symbols compiled for the current module. 'level' +### may take only one of the following values: DEFAULT, HIDDEN. +macro VISIBILITY(LEVEL) { + SET(_VISIBILITY_LEVEL ${LEVEL}) + select ($LEVEL) { + "DEFAULT" | "HIDDEN" ? { + } + default ? { + _OK = no + } + } + ASSERT(_OK Unsupported value [$LEVEL] passed to VISIBILITY macro, expected values are DEFAULT, HIDDEN.) +} + # tag:cpp-specific -_CFLAGS_VISIBILITY= -when ($_VISIBILITY_LEVEL != "" && $IGNORE_VISIBILITY != "yes") { - when ($CLANG == "yes" || $GCC == "yes") { - _CFLAGS_VISIBILITY=-fvisibility=${tolower:_VISIBILITY_LEVEL} - } -} -CFLAGS+=$_CFLAGS_VISIBILITY +_CFLAGS_VISIBILITY= +when ($_VISIBILITY_LEVEL != "" && $IGNORE_VISIBILITY != "yes") { + when ($CLANG == "yes" || $GCC == "yes") { + _CFLAGS_VISIBILITY=-fvisibility=${tolower:_VISIBILITY_LEVEL} + } +} +CFLAGS+=$_CFLAGS_VISIBILITY # tag:cpp-specific macro SDBUS_CPP_ADAPTOR(File) { @@ -9249,23 +9249,23 @@ module MCU_PROGRAM: PROGRAM { macro METAQUERYFILES(Files...) { ENABLE(UNUSED_MACRO) } - + # tag:flags tag:internal tag:windows-specific -### @usage: _MSVC_FLAGS_WINDOWS_IMPL(target_platform compiler_flags) # internal -### -### Add CFLAGS when the firts argument is WINDOWS -macro _MSVC_FLAGS_WINDOWS_IMPL(WINDOWS[], FLAGS...) { - CFLAGS($WINDOWS) -} - +### @usage: _MSVC_FLAGS_WINDOWS_IMPL(target_platform compiler_flags) # internal +### +### Add CFLAGS when the firts argument is WINDOWS +macro _MSVC_FLAGS_WINDOWS_IMPL(WINDOWS[], FLAGS...) { + CFLAGS($WINDOWS) +} + # tag:flags tag:windows-specific tag:cpp-specific -### @usage: MSVC_FLAGS([GLOBAL compiler_flag]* compiler_flags) -### -### Add the specified flags to the compilation line of C/C++files. -### Flags apply only if the compiler used is MSVC (cl.exe) -macro MSVC_FLAGS(FLAGS...) { - _MSVC_FLAGS_WINDOWS_IMPL($TARGET_PLATFORM $FLAGS) -} +### @usage: MSVC_FLAGS([GLOBAL compiler_flag]* compiler_flags) +### +### Add the specified flags to the compilation line of C/C++files. +### Flags apply only if the compiler used is MSVC (cl.exe) +macro MSVC_FLAGS(FLAGS...) { + _MSVC_FLAGS_WINDOWS_IMPL($TARGET_PLATFORM $FLAGS) +} ### @usage: COLLECT_YDB_API_SPECS_LEGACY(VarName Paths...) #deprecated ### |