opensource.conf 3.0 KB

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