aboutsummaryrefslogtreecommitdiffstats
path: root/build/conf/opensource.conf
diff options
context:
space:
mode:
authoralexv-smirnov <alex@ydb.tech>2023-06-13 11:05:01 +0300
committeralexv-smirnov <alex@ydb.tech>2023-06-13 11:05:01 +0300
commitbf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0 (patch)
tree1d1df72c0541a59a81439842f46d95396d3e7189 /build/conf/opensource.conf
parent8bfdfa9a9bd19bddbc58d888e180fbd1218681be (diff)
downloadydb-bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0.tar.gz
add ymake export to ydb
Diffstat (limited to 'build/conf/opensource.conf')
-rw-r--r--build/conf/opensource.conf84
1 files changed, 84 insertions, 0 deletions
diff --git a/build/conf/opensource.conf b/build/conf/opensource.conf
new file mode 100644
index 0000000000..408e45c8b9
--- /dev/null
+++ b/build/conf/opensource.conf
@@ -0,0 +1,84 @@
+EXPORT_CMAKE=no
+EXPORT_GRADLE=no
+
+when ($OPENSOURCE == "yes" || $OPENSOURCE_PROJECT == "ymake" || $OPENSOURCE_PROJECT == "ya") {
+ YA_OPENSOURCE=yes
+}
+
+when ($CATBOOST_OPENSOURCE == "yes") {
+ OPENSOURCE=yes
+ CFLAGS+=-DCATBOOST_OPENSOURCE=yes
+ CXXFLAGS+=-DCATBOOST_OPENSOURCE=yes
+}
+
+when ($OPENSOURCE == "yes") {
+ LOCAL_YDB_DOCKER_PUBLIC_BUILD=yes
+ CATBOOST_OPENSOURCE=yes
+ GO_VET=no
+ USE_DYNAMIC_IDN=yes
+ USE_DYNAMIC_AIO=yes
+ USE_DYNAMIC_ICONV=yes
+ USE_ASMLIB=no
+ SO_OUTPUTS=yes
+ UDF_NO_PROBE=yes
+ HAVE_MKL=no
+ USE_MKL=no
+ USE_PREBUILT_TOOLS=no
+}
+
+# Extra macros to control how gradle export works
+
+when ($OPENSOURCE == "yes" && $EXPORT_GRADLE == "yes") {
+ RECURSIVE_ADD_PEERS_TESTS=yes
+ EXPORT_SEM=yes
+}
+
+# Extra macros to control how cmake export works
+
+when ($OPENSOURCE == "yes" && $EXPORT_CMAKE == "yes") {
+ # Python version is not acttually used in exported cmake's rigth now.
+ # The only reason to set it is to avoid any deps on contrib/python|contrib/libs/python when
+ # exporting PY_*_MODULE and force dependency to build/platform/python there.
+ USE_SYSTEM_PYTHON=3.10
+ USE_ARCADIA_PYTHON=no
+ # YMAKE-477. yexport does not support USE_GLOBAL_CMD=no and crashes with OOM.
+ # USE_GLOBAL_CMD=yes does not work for Windows with ya make builds but works with exported CMake files: YMAKE-657.
+ USE_GLOBAL_CMD=yes
+ EXPORT_SEM=yes
+}
+
+CMAKE_PACKAGE=
+CMAKE_PACKAGE_COMPONENT=
+CMAKE_PACKAGE_TARGET=
+CONAN_REFERENCE=
+CONAN_PKG_OPTS=
+### @usage: OPENSOURCE_EXPORT_REPLACEMENT(CMAKE PkgName CMAKE_TARGET PkgName::PkgTarget CONAN ConanRef CMAKE_COMPONENT OptCmakePkgComponent)
+###
+### Use specified conan/system pacakcge when exporting cmake build scripts for arcadia C++ project
+### for opensource publication.
+macro OPENSOURCE_EXPORT_REPLACEMENT(CMAKE[], CMAKE_TARGET[], CMAKE_COMPONENT[], CONAN[], CONAN_OPTIONS[]) {
+ SET(CMAKE_PACKAGE $CMAKE)
+ SET(CMAKE_PACKAGE_COMPONENT $CMAKE_COMPONENT)
+ SET(CMAKE_LINK_TARGET $CMAKE_TARGET)
+ SET(CONAN_REFERENCE $CONAN)
+ SET(CONAN_PKG_OPTS $CONAN_OPTIONS)
+}
+
+CMAKE_TARGET_NAME=$REALPRJNAME
+CMAKE_TARGET_ARTEFACT_RENAME_RULES=
+### @usage CMAKE_EXPORTED_TARGET_NAME(Name)
+###
+### Forces to use the name given as cmake target name without changing the name of output artefact.
+### This macro should be used to resolve target name conflicts in exported cmake project when
+### changing module name is not applicable. For example both CUDA and non-CUDA py modules for
+### catboost should have same name lib_catboost.so and both of them are defined as PY_ANY_MODULE(_catboost).
+### adding CMAKE_EXPORTED_TARGET_NAME(_catboost_non_cuda) to the non CUDA module ya.make file
+### changes exported cmake target name but preserve generated artefact file name.
+macro CMAKE_EXPORTED_TARGET_NAME(Name) {
+ SET(CMAKE_TARGET_NAME $Name)
+ SET(CMAKE_TARGET_ARTEFACT_RENAME_RULES && set_target_property OUTPUT_NAME $REALPRJNAME)
+}
+
+macro ALLOCATOR_IMPL() {
+ SET(CPP_LIBRARY_INDUCED_SEM_PROPERTY target_allocator)
+}