CMakeLists.txt 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # This file was generated 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 C CXX ASM)
  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. list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake)
  15. include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
  16. list(APPEND CMAKE_CTEST_ARGUMENTS "--output-on-failure")
  17. enable_testing()
  18. # Disable 'empty CUDA_ARCHITECTURES not allowed' warning
  19. # Can't set it in cuda.cmake because of CMake policy subdirectory stack rules
  20. cmake_policy(SET CMP0104 OLD)
  21. include(cmake/antlr.cmake)
  22. include(cmake/archive.cmake)
  23. include(cmake/bison.cmake)
  24. include(cmake/common.cmake)
  25. include(cmake/conan.cmake)
  26. include(cmake/global_flags.cmake)
  27. include(cmake/llvm-tools.cmake)
  28. include(cmake/protobuf.cmake)
  29. include(cmake/global_vars.cmake)
  30. if (CMAKE_CROSSCOMPILING)
  31. include(${CMAKE_BINARY_DIR}/conan_paths.cmake)
  32. else()
  33. conan_cmake_autodetect(settings)
  34. conan_cmake_install(
  35. PATH_OR_REFERENCE ${CMAKE_SOURCE_DIR}
  36. INSTALL_FOLDER ${CMAKE_BINARY_DIR}
  37. BUILD missing
  38. REMOTE conancenter
  39. SETTINGS ${settings}
  40. ENV "CONAN_CMAKE_GENERATOR=${CMAKE_GENERATOR}"
  41. CONF "tools.cmake.cmaketoolchain:generator=${CMAKE_GENERATOR}"
  42. )
  43. endif()
  44. if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND NOT HAVE_CUDA)
  45. include(CMakeLists.linux-x86_64.txt)
  46. elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND NOT HAVE_CUDA)
  47. include(CMakeLists.linux-aarch64.txt)
  48. elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
  49. include(CMakeLists.darwin-x86_64.txt)
  50. elseif (WIN32 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" AND NOT HAVE_CUDA)
  51. include(CMakeLists.windows-x86_64.txt)
  52. endif()