CMakeLists.txt 2.5 KB

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