aboutsummaryrefslogtreecommitdiffstats
path: root/build/conf/opensource.conf
blob: 83c23d14212bd9ea35c1af2a5ff9c0ad81981193 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
EXPORT_CMAKE=no

when ($CATBOOST_OPENSOURCE == "yes") {
    OPENSOURCE=yes
    CFLAGS+=-DCATBOOST_OPENSOURCE=yes
    CXXFLAGS+=-DCATBOOST_OPENSOURCE=yes
}

when ($OPENSOURCE) {
    LOCAL_YDB_DOCKER_PUBLIC_BUILD=yes
    CATBOOST_OPENSOURCE=yes
    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
}

# Extra macros to control how cmake export works

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_COMPONENET[], CONAN[], CONAN_OPTIONS[]) {
    SET(CMAKE_PACKAGE $CMAKE)
    SET(CMAKE_PACKAGE_COMPONENT $CMAKE_COMPONENET)
    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)
}