opensource.conf 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. EXPORT_CMAKE=no
  2. EXPORT_GRADLE=no
  3. when ($OPENSOURCE == "yes" || $OPENSOURCE_PROJECT == "ymake" || $OPENSOURCE_PROJECT == "ya") {
  4. YA_OPENSOURCE=yes
  5. }
  6. when ($CATBOOST_OPENSOURCE == "yes") {
  7. OPENSOURCE=yes
  8. CFLAGS+=-DCATBOOST_OPENSOURCE=yes
  9. CXXFLAGS+=-DCATBOOST_OPENSOURCE=yes
  10. }
  11. when ($OPENSOURCE == "yes") {
  12. LOCAL_YDB_DOCKER_PUBLIC_BUILD=yes
  13. CATBOOST_OPENSOURCE=yes
  14. GO_VET=no
  15. USE_DYNAMIC_IDN=yes
  16. USE_DYNAMIC_AIO=yes
  17. USE_DYNAMIC_ICONV=yes
  18. USE_ASMLIB=no
  19. SO_OUTPUTS=yes
  20. UDF_NO_PROBE=yes
  21. HAVE_MKL=no
  22. USE_MKL=no
  23. }
  24. # Extra macros to control how gradle export works
  25. when ($OPENSOURCE == "yes" && $EXPORT_GRADLE == "yes") {
  26. RECURSIVE_ADD_PEERS_TESTS=yes
  27. EXPORT_SEM=yes
  28. }
  29. # Extra macros to control how cmake export works
  30. when ($OPENSOURCE == "yes" && $EXPORT_CMAKE == "yes") {
  31. # Python version is not acttually used in exported cmake's rigth now.
  32. # The only reason to set it is to avoid any deps on contrib/python|contrib/libs/python when
  33. # exporting PY_*_MODULE and force dependency to build/platform/python there.
  34. USE_SYSTEM_PYTHON=3.10
  35. USE_ARCADIA_PYTHON=no
  36. # YMAKE-477. yexport does not support USE_GLOBAL_CMD=no and crashes with OOM.
  37. # USE_GLOBAL_CMD=yes does not work for Windows with ya make builds but works with exported CMake files: YMAKE-657.
  38. USE_GLOBAL_CMD=yes
  39. EXPORT_SEM=yes
  40. }
  41. CMAKE_PACKAGE=
  42. CMAKE_PACKAGE_COMPONENT=
  43. CMAKE_PACKAGE_TARGET=
  44. CONAN_REFERENCE=
  45. CONAN_PKG_OPTS=
  46. ### @usage: OPENSOURCE_EXPORT_REPLACEMENT(CMAKE PkgName CMAKE_TARGET PkgName::PkgTarget CONAN ConanRef CMAKE_COMPONENT OptCmakePkgComponent)
  47. ###
  48. ### Use specified conan/system pacakcge when exporting cmake build scripts for arcadia C++ project
  49. ### for opensource publication.
  50. macro OPENSOURCE_EXPORT_REPLACEMENT(CMAKE[], CMAKE_TARGET[], CMAKE_COMPONENT[], CONAN[], CONAN_OPTIONS[]) {
  51. SET(CMAKE_PACKAGE $CMAKE)
  52. SET(CMAKE_PACKAGE_COMPONENT $CMAKE_COMPONENT)
  53. SET(CMAKE_LINK_TARGET $CMAKE_TARGET)
  54. SET(CONAN_REFERENCE $CONAN)
  55. SET(CONAN_PKG_OPTS $CONAN_OPTIONS)
  56. }
  57. CMAKE_TARGET_NAME=$REALPRJNAME
  58. CMAKE_TARGET_ARTEFACT_RENAME_RULES=
  59. ### @usage CMAKE_EXPORTED_TARGET_NAME(Name)
  60. ###
  61. ### Forces to use the name given as cmake target name without changing the name of output artefact.
  62. ### This macro should be used to resolve target name conflicts in exported cmake project when
  63. ### changing module name is not applicable. For example both CUDA and non-CUDA py modules for
  64. ### catboost should have same name lib_catboost.so and both of them are defined as PY_ANY_MODULE(_catboost).
  65. ### adding CMAKE_EXPORTED_TARGET_NAME(_catboost_non_cuda) to the non CUDA module ya.make file
  66. ### changes exported cmake target name but preserve generated artefact file name.
  67. macro CMAKE_EXPORTED_TARGET_NAME(Name) {
  68. SET(CMAKE_TARGET_NAME $Name)
  69. SET(CMAKE_TARGET_ARTEFACT_RENAME_RULES && set_target_property OUTPUT_NAME $REALPRJNAME)
  70. }
  71. macro ALLOCATOR_IMPL() {
  72. SET(CPP_LIBRARY_INDUCED_SEM_PROPERTY target_allocator)
  73. }