diff options
author | tekireeva <tekireeva@yandex-team.ru> | 2022-04-07 05:39:43 +0300 |
---|---|---|
committer | tekireeva <tekireeva@yandex-team.ru> | 2022-04-07 05:39:43 +0300 |
commit | 914ef38ca5345f6a72aee6fe25ce75bfbd3af657 (patch) | |
tree | 085701f4e93b610a12543cc2d352680248d91c4e /build | |
parent | 65c3e8ef8c1de877793355ddd13ea30d262709c8 (diff) | |
download | ydb-914ef38ca5345f6a72aee6fe25ce75bfbd3af657.tar.gz |
YMAKE-107 Support cython
ref:e5257d21ea81188b08a1425ef00bae9933b0e054
Diffstat (limited to 'build')
-rw-r--r-- | build/ymake.core.conf | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/build/ymake.core.conf b/build/ymake.core.conf index 010d304979..d71c5e5414 100644 --- a/build/ymake.core.conf +++ b/build/ymake.core.conf @@ -299,6 +299,7 @@ ENUM_PARSER_TOOL=${tool:"tools/enum_parser/enum_parser"} # tag:python-specific tag:cython-specific CYTHON_SCRIPT=${input:"${ARCADIA_ROOT}/contrib/tools/cython/cython.py"} RUN_CYTHON_SCRIPT=$YMAKE_PYTHON $CYTHON_SCRIPT +PYTHON_TYPE_FOR_CYTHON=PY2 CYTHON_OUTPUT_INCLUDES=\ ${output_include;hide:"contrib/libs/python/Include/compile.h"} \ ${output_include;hide:"contrib/libs/python/Include/frameobject.h"} \ @@ -3911,6 +3912,7 @@ module PY3_LIBRARY: _LIBRARY { PEERDIR($YMAKE_PYTHON3_PEER) RUN_CYTHON_SCRIPT=$YMAKE_PYTHON3 $CYTHON_SCRIPT + PYTHON_TYPE_FOR_CYTHON=PY3 when ($PY_PROTO_MYPY_ENABLED == "yes") { PY_PROTO_MYPY_SUFFIX=_pb2.pyi @@ -4905,6 +4907,7 @@ multimodule SANDBOX_PY23_TASK { REGISTER_SANDBOX_IMPORT(${MODDIR}) OBJ_SUF=.py2 RUN_CYTHON_SCRIPT=$YMAKE_PYTHON $CYTHON_SCRIPT + PYTHON_TYPE_FOR_CYTHON=PY2 } module PY3: PY3_LIBRARY { when ($MSVC == "yes" || $CYGWIN == "yes") { @@ -4915,6 +4918,7 @@ multimodule SANDBOX_PY23_TASK { } OBJ_SUF=.py3 RUN_CYTHON_SCRIPT=$YMAKE_PYTHON $CYTHON_SCRIPT + PYTHON_TYPE_FOR_CYTHON=PY2 PEERDIR(sandbox/sdk2) REGISTER_SANDBOX_IMPORT(${MODDIR}) } @@ -5763,6 +5767,7 @@ macro _SRC("cfgproto", 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} ${kv;hide:"p CY"} ${kv;hide:"pc yellow"} + .SEM=target_cython_sources PRIVATE ${input:Src} ${output;hide;tobindir:Src.fake.o} && target_cython_options $CYTHON_OPTIONS --cplus ${SRCFLAGS} ${CYTHON_CPP_OUTPUT_INCLUDES} && target_cython_include_directories $_CYTHON__INCLUDE && set_python_type_for_cython $PYTHON_TYPE_FOR_CYTHON .ADDINCL=FOR cython contrib/tools/cython/Cython/Includes } @@ -6203,6 +6208,7 @@ macro SRC_CPP_AVX2(FILE, FLAGS...) { ### Generates .cpp file from .pyx. 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 ${kv;hide:"p CY"} ${kv;hide:"pc yellow"} + .SEM=target_cython_sources PRIVATE ${input:Src} ${output;hide;tobindir:Src.fake.o} && target_cython_options $CYTHON_OPTIONS ${Options} --cplus ${CYTHON_CPP_OUTPUT_INCLUDES} && target_cython_include_directories $_CYTHON__INCLUDE && set_python_type_for_cython $PYTHON_TYPE_FOR_CYTHON ADDINCL(FOR cython contrib/tools/cython/Cython/Includes) } @@ -6213,6 +6219,7 @@ macro BUILDWITH_CYTHON_CPP(Src, Options...) { ### If Dep changes the .cpp file will be re-generated. macro _BUILDWITH_CYTHON_CPP_DEP(Src, Dep, Options...) { .CMD=$RUN_CYTHON_SCRIPT $CYTHON_OPTIONS ${Options} --cplus ${CYTHON_CPP_OUTPUT_INCLUDES} ${pre=-I:_CYTHON__INCLUDE} ${input:Src} ${input;hide:Dep} -o ${output;tobindir:Src.cpp} $CYTHON_OUTPUT_INCLUDES ${kv;hide:"p CY"} ${kv;hide:"pc yellow"} + .SEM=target_cython_sources PRIVATE ${input:Src} ${input;hide:Dep} ${output;hide;tobindir:Src.fake.o} && target_cython_options $CYTHON_OPTIONS ${Options} --cplus ${CYTHON_CPP_OUTPUT_INCLUDES} && target_cython_include_directories $_CYTHON__INCLUDE && set_python_type_for_cython $PYTHON_TYPE_FOR_CYTHON ADDINCL(FOR cython contrib/tools/cython/Cython/Includes) } @@ -6222,6 +6229,7 @@ macro _BUILDWITH_CYTHON_CPP_DEP(Src, Dep, Options...) { ### Generates .c file from .pyx. 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 ${kv;hide:"p CY"} ${kv;hide:"pc yellow"} + .SEM=target_cython_sources PRIVATE ${input:Src} ${output;hide;tobindir:Src.fake.o} && target_cython_options $CYTHON_OPTIONS ${Options} ${CYTHON_OUTPUT_INCLUDES} && target_cython_include_directories $_CYTHON__INCLUDE && set_python_type_for_cython $PYTHON_TYPE_FOR_CYTHON ADDINCL(FOR cython contrib/tools/cython/Cython/Includes) } @@ -6232,6 +6240,7 @@ macro BUILDWITH_CYTHON_C(Src, Options...) { ### If Dep changes the .c file will be re-generated. macro _BUILDWITH_CYTHON_C_DEP(Src, Dep, Options...) { .CMD=$RUN_CYTHON_SCRIPT $CYTHON_OPTIONS ${Options} ${pre=-I:_CYTHON__INCLUDE} ${input:Src} ${input;hide:Dep} -o ${output;tobindir:Src.c} $CYTHON_OUTPUT_INCLUDES ${kv;hide:"p CY"} ${kv;hide:"pc yellow"} + .SEM=target_cython_sources PRIVATE ${input:Src} ${input;hide:Dep} ${output;hide;tobindir:Src.fake.o} && target_cython_options $CYTHON_OPTIONS ${Options} ${CYTHON_OUTPUT_INCLUDES} && target_cython_include_directories $_CYTHON__INCLUDE && set_python_type_for_cython $PYTHON_TYPE_FOR_CYTHON ADDINCL(FOR cython contrib/tools/cython/Cython/Includes) } @@ -8809,9 +8818,11 @@ multimodule PY23_LIBRARY { module PY2: PY2_LIBRARY { OBJ_SUF=.py2 RUN_CYTHON_SCRIPT=$YMAKE_PYTHON $CYTHON_SCRIPT + PYTHON_TYPE_FOR_CYTHON=PY2 } module PY3: PY3_LIBRARY { RUN_CYTHON_SCRIPT=$YMAKE_PYTHON $CYTHON_SCRIPT + PYTHON_TYPE_FOR_CYTHON=PY2 when ($MSVC == "yes" || $CYGWIN == "yes") { MODULE_PREFIX=py3 } @@ -9040,18 +9051,21 @@ multimodule PY23_TEST { OBJ_SUF=.py2 CANONIZE_SUB_PATH=py2test RUN_CYTHON_SCRIPT=$YMAKE_PYTHON $CYTHON_SCRIPT + PYTHON_TYPE_FOR_CYTHON=PY2 } module PY3TEST_PROGRAM: PY3TEST_BIN { .FINAL_TARGET=yes OBJ_SUF=.py3 CANONIZE_SUB_PATH=py3test RUN_CYTHON_SCRIPT=$YMAKE_PYTHON $CYTHON_SCRIPT + PYTHON_TYPE_FOR_CYTHON=PY2 } module PY3TEST_LIBRARY: PY3_LIBRARY { PEERDIR+=library/python/pytest _REQUIRE_EXPLICIT_LICENSE() RUN_CYTHON_SCRIPT=$YMAKE_PYTHON $CYTHON_SCRIPT + PYTHON_TYPE_FOR_CYTHON=PY2 } } |