SCsub 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. #!/usr/bin/env python
  2. from misc.utility.scons_hints import *
  3. import os
  4. import editor_builders
  5. Import("env")
  6. env.editor_sources = []
  7. if env.editor_build:
  8. # Generate doc data paths
  9. env.CommandNoCache(
  10. "doc/doc_data_class_path.gen.h",
  11. env.Value(env.doc_class_path),
  12. env.Run(editor_builders.doc_data_class_path_builder),
  13. )
  14. # Register exporters
  15. gen_exporters = env.CommandNoCache(
  16. "export/register_exporters.gen.cpp",
  17. env.Value(env.platform_exporters),
  18. env.Run(editor_builders.register_exporters_builder),
  19. )
  20. for e in env.platform_exporters:
  21. # Add all .cpp files in export folder
  22. env.add_source_files(env.editor_sources, f"../platform/{e}/export/*.cpp")
  23. # Core API documentation.
  24. docs = []
  25. docs += Glob("#doc/classes/*.xml")
  26. # Module API documentation.
  27. module_dirs = []
  28. for d in env.doc_class_path.values():
  29. if d not in module_dirs:
  30. module_dirs.append(d)
  31. for d in module_dirs:
  32. if not os.path.isabs(d):
  33. docs += Glob("#" + d + "/*.xml") # Built-in.
  34. else:
  35. docs += Glob(d + "/*.xml") # Custom.
  36. docs = sorted(docs)
  37. env.CommandNoCache(
  38. "#editor/doc/doc_data_compressed.gen.h",
  39. docs,
  40. env.Run(editor_builders.make_doc_header),
  41. )
  42. # Editor interface and class reference translations incur a significant size
  43. # cost for the editor binary (see godot-proposals#3421).
  44. # To limit it, we only include translations with a high enough completion
  45. # ratio (20% for the editor UI, 10% for the class reference).
  46. # Generated with `make include-list` for each resource.
  47. # Editor translations
  48. env.CommandNoCache(
  49. "#editor/translations/editor_translations.gen.h",
  50. Glob("#editor/translations/editor/*"),
  51. env.Run(editor_builders.make_translations_header),
  52. )
  53. # Property translations
  54. env.CommandNoCache(
  55. "#editor/translations/property_translations.gen.h",
  56. Glob("#editor/translations/properties/*"),
  57. env.Run(editor_builders.make_translations_header),
  58. )
  59. # Documentation translations
  60. env.CommandNoCache(
  61. "#editor/translations/doc_translations.gen.h",
  62. Glob("#doc/translations/*"),
  63. env.Run(editor_builders.make_translations_header),
  64. )
  65. # Extractable translations
  66. env.CommandNoCache(
  67. "#editor/translations/extractable_translations.gen.h",
  68. Glob("#editor/translations/extractable/*"),
  69. env.Run(editor_builders.make_translations_header),
  70. )
  71. env.add_source_files(env.editor_sources, "*.cpp")
  72. env.add_source_files(env.editor_sources, gen_exporters)
  73. SConscript("animation/SCsub")
  74. SConscript("asset_library/SCsub")
  75. SConscript("audio/SCsub")
  76. SConscript("debugger/SCsub")
  77. SConscript("doc/SCsub")
  78. SConscript("docks/SCsub")
  79. SConscript("export/SCsub")
  80. SConscript("file_system/SCsub")
  81. SConscript("gui/SCsub")
  82. SConscript("icons/SCsub")
  83. SConscript("inspector/SCsub")
  84. SConscript("import/SCsub")
  85. SConscript("plugins/SCsub")
  86. SConscript("project_manager/SCsub")
  87. SConscript("project_upgrade/SCsub")
  88. SConscript("run/SCsub")
  89. SConscript("settings/SCsub")
  90. SConscript("scene/SCsub")
  91. SConscript("script/SCsub")
  92. SConscript("shader/SCsub")
  93. SConscript("themes/SCsub")
  94. SConscript("translations/SCsub")
  95. SConscript("version_control/SCsub")
  96. lib = env.add_library("editor", env.editor_sources)
  97. env.Prepend(LIBS=[lib])