NinjaDependInfoCompileDatabase.cmake 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. set(CMAKE_INTERMEDIATE_DIR_STRATEGY FULL CACHE STRING "" FORCE)
  2. # Fake out that we have dyndep; we only need to generate, not actually build
  3. # here.
  4. set(CMAKE_CXX_SCANDEP_SOURCE "")
  5. set(CMAKE_EXPERIMENTAL_EXPORT_BUILD_DATABASE "73194a1d-c0b5-41b9-9190-a4512925e192")
  6. enable_language(CXX)
  7. if (NOT CMAKE_GENERATOR MATCHES "Ninja")
  8. message(FATAL_ERROR
  9. "This test requires a 'Ninja' generator to be used.")
  10. endif ()
  11. add_library(ninja-compiledb-public)
  12. target_sources(ninja-compiledb-public
  13. PRIVATE
  14. sources/module-impl.cxx
  15. sources/module-internal-part-impl.cxx
  16. sources/module-part-impl.cxx
  17. PUBLIC
  18. FILE_SET modules TYPE CXX_MODULES
  19. BASE_DIRS
  20. "${CMAKE_CURRENT_SOURCE_DIR}/sources"
  21. FILES
  22. sources/module.cxx
  23. sources/module-part.cxx
  24. FILE_SET internal_partitions TYPE CXX_MODULES FILES
  25. sources/module-internal-part.cxx)
  26. target_compile_features(ninja-compiledb-public
  27. PRIVATE
  28. cxx_std_20)
  29. set_property(TARGET ninja-compiledb-public
  30. PROPERTY EXPORT_BUILD_DATABASE 1)
  31. add_library(ninja-compiledb-private)
  32. target_sources(ninja-compiledb-private
  33. PRIVATE
  34. sources/module-impl.cxx
  35. sources/module-internal-part-impl.cxx
  36. sources/module-part-impl.cxx
  37. PRIVATE
  38. FILE_SET modules TYPE CXX_MODULES
  39. BASE_DIRS
  40. "${CMAKE_CURRENT_SOURCE_DIR}/sources"
  41. FILES
  42. sources/module.cxx
  43. sources/module-part.cxx
  44. FILE_SET internal_partitions TYPE CXX_MODULES FILES
  45. sources/module-internal-part.cxx)
  46. target_compile_features(ninja-compiledb-private
  47. PRIVATE
  48. cxx_std_20)
  49. set_property(TARGET ninja-compiledb-private
  50. PROPERTY EXPORT_BUILD_DATABASE 1)