CMakeLists.txt 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. # This file was gererated by the build system used internally in the Yandex monorepo.
  2. # Only simple modifications are allowed (adding source-files to targets, adding simple properties
  3. # like target_include_directories). These modifications will be ported to original
  4. # ya.make files by maintainers. Any complex modifications which can't be ported back to the
  5. # original buildsystem will not be accepted.
  6. cmake_minimum_required(VERSION 3.15)
  7. project(YDB LANGUAGES ASM C CXX)
  8. set(BUILD_SHARED_LIBS Off)
  9. set(CMAKE_CXX_STANDARD 20)
  10. set(CMAKE_CXX_EXTENSIONS Off)
  11. set(YDB_MAX_LINK_JOBS 5 CACHE STRING "Maximum parallel link jobs for Ninja generator")
  12. set_property(GLOBAL PROPERTY JOB_POOLS link_jobs=${YDB_MAX_LINK_JOBS})
  13. set(CMAKE_JOB_POOL_LINK link_jobs)
  14. set(CMAKE_C_FLAGS "\
  15. -m64 \
  16. -fexceptions \
  17. -fno-common \
  18. -fuse-init-array \
  19. -fcolor-diagnostics \
  20. -faligned-allocation \
  21. -ffunction-sections \
  22. -fdata-sections \
  23. -Wall \
  24. -Wextra \
  25. -Wno-parentheses \
  26. -Wno-implicit-const-int-float-conversion \
  27. -Wno-unknown-warning-option \
  28. -D_THREAD_SAFE \
  29. -D_PTHREADS \
  30. -D_REENTRANT \
  31. -D_LARGEFILE_SOURCE \
  32. -D__STDC_CONSTANT_MACROS \
  33. -D__STDC_FORMAT_MACROS \
  34. -D_FILE_OFFSET_BITS=64 \
  35. -D_GNU_SOURCE \
  36. -D_YNDX_LIBUNWIND_ENABLE_EXCEPTION_BACKTRACE \
  37. -D__LONG_LONG_SUPPORTED \
  38. -DSSE_ENABLED=1 \
  39. -DSSE3_ENABLED=1 \
  40. -DSSSE3_ENABLED=1 \
  41. -DSSE41_ENABLED=1 \
  42. -DSSE42_ENABLED=1 \
  43. -DPOPCNT_ENABLED=1 \
  44. -DCX16_ENABLED=1 \
  45. -D_libunwind_ \
  46. -DLIBCXX_BUILDING_LIBCXXRT \
  47. -msse2 \
  48. -msse3 \
  49. -mssse3 \
  50. -msse4.1 \
  51. -msse4.2 \
  52. -mpopcnt \
  53. -mcx16 \
  54. "
  55. )
  56. set(CMAKE_CXX_FLAGS "\
  57. -m64 \
  58. -fexceptions \
  59. -fno-common \
  60. -fuse-init-array \
  61. -fcolor-diagnostics \
  62. -faligned-allocation \
  63. -ffunction-sections \
  64. -fdata-sections \
  65. -Wall \
  66. -Wextra \
  67. -Wno-parentheses \
  68. -Wno-implicit-const-int-float-conversion \
  69. -Wno-unknown-warning-option \
  70. -D_THREAD_SAFE \
  71. -D_PTHREADS \
  72. -D_REENTRANT \
  73. -D_LARGEFILE_SOURCE \
  74. -D__STDC_CONSTANT_MACROS \
  75. -D__STDC_FORMAT_MACROS \
  76. -D_FILE_OFFSET_BITS=64 \
  77. -D_GNU_SOURCE \
  78. -D_YNDX_LIBUNWIND_ENABLE_EXCEPTION_BACKTRACE \
  79. -D__LONG_LONG_SUPPORTED \
  80. -DSSE_ENABLED=1 \
  81. -DSSE3_ENABLED=1 \
  82. -DSSSE3_ENABLED=1 \
  83. -DSSE41_ENABLED=1 \
  84. -DSSE42_ENABLED=1 \
  85. -DPOPCNT_ENABLED=1 \
  86. -DCX16_ENABLED=1 \
  87. -D_libunwind_ \
  88. -DLIBCXX_BUILDING_LIBCXXRT \
  89. -msse2 \
  90. -msse3 \
  91. -mssse3 \
  92. -msse4.1 \
  93. -msse4.2 \
  94. -mpopcnt \
  95. -mcx16 \
  96. -Woverloaded-virtual \
  97. -Wimport-preprocessor-directive-pedantic \
  98. -Wno-undefined-var-template \
  99. -Wno-return-std-move \
  100. -Wno-address-of-packed-member \
  101. -Wno-defaulted-function-deleted \
  102. -Wno-pessimizing-move \
  103. -Wno-range-loop-construct \
  104. -Wno-deprecated-anon-enum-enum-conversion \
  105. -Wno-deprecated-enum-enum-conversion \
  106. -Wno-deprecated-enum-float-conversion \
  107. -Wno-ambiguous-reversed-operator \
  108. -Wno-deprecated-volatile \
  109. "
  110. )
  111. add_link_options(
  112. -nodefaultlibs
  113. -lc
  114. -lm
  115. )
  116. list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake)
  117. include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
  118. list(APPEND CMAKE_CTEST_ARGUMENTS "--output-on-failure")
  119. enable_testing()
  120. include(cmake/antlr.cmake)
  121. include(cmake/bison.cmake)
  122. include(cmake/conan.cmake)
  123. include(cmake/protobuf.cmake)
  124. include(cmake/yandex_common.cmake)
  125. include(cmake/global_vars.cmake)
  126. conan_cmake_configure(
  127. GENERATORS cmake_find_package
  128. REQUIRES
  129. bison/3.5.3
  130. c-ares/1.17.2
  131. libiconv/1.15
  132. openssl/1.1.1l
  133. ragel/6.10
  134. yasm/1.3.0
  135. zlib/1.2.12
  136. IMPORTS
  137. "bin, *yasm* -> ./bin"
  138. "bin, bison* -> ./bin/bison/bin"
  139. "bin, ragel* -> ./bin"
  140. "bin, ytasm* -> ./bin"
  141. "res, * -> ./bin/bison/res"
  142. OPTIONS
  143. libiconv:shared=True
  144. )
  145. conan_cmake_autodetect(settings)
  146. conan_cmake_install(
  147. PATH_OR_REFERENCE .
  148. BUILD missing
  149. REMOTE conancenter
  150. SETTINGS ${settings}
  151. )
  152. if (UNIX)
  153. include(CMakeLists.linux.txt)
  154. elseif (APPLE)
  155. include(CMakeLists.darwin.txt)
  156. endif()