CMakeLists.txt 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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/global_flags.cmake)
  22. include(cmake/global_vars.cmake)
  23. include(cmake/antlr.cmake)
  24. include(cmake/archive.cmake)
  25. include(cmake/bison.cmake)
  26. include(cmake/common.cmake)
  27. include(cmake/conan.cmake)
  28. include(cmake/fbs.cmake)
  29. include(cmake/masm.cmake)
  30. include(cmake/protobuf.cmake)
  31. include(cmake/shared_libs.cmake)
  32. if (CMAKE_CROSSCOMPILING)
  33. include(${CMAKE_BINARY_DIR}/conan_paths.cmake)
  34. else()
  35. conan_cmake_autodetect(settings)
  36. conan_cmake_install(
  37. PATH_OR_REFERENCE ${CMAKE_SOURCE_DIR}
  38. INSTALL_FOLDER ${CMAKE_BINARY_DIR}
  39. BUILD missing
  40. REMOTE conancenter
  41. SETTINGS ${settings}
  42. ENV "CONAN_CMAKE_GENERATOR=${CMAKE_GENERATOR}"
  43. CONF "tools.cmake.cmaketoolchain:generator=${CMAKE_GENERATOR}"
  44. )
  45. endif()
  46. if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" AND NOT HAVE_CUDA)
  47. include(CMakeLists.linux-x86_64.txt)
  48. elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND NOT HAVE_CUDA)
  49. include(CMakeLists.linux-aarch64.txt)
  50. elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
  51. include(CMakeLists.darwin-x86_64.txt)
  52. elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
  53. include(CMakeLists.darwin-arm64.txt)
  54. elseif (WIN32 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "AMD64" AND NOT HAVE_CUDA)
  55. include(CMakeLists.windows-x86_64.txt)
  56. endif()