123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- #!/usr/bin/env python
- from misc.utility.scons_hints import *
- import os
- import editor_builders
- Import("env")
- env.editor_sources = []
- if env.editor_build:
- # Generate doc data paths
- env.CommandNoCache(
- "doc_data_class_path.gen.h", env.Value(env.doc_class_path), env.Run(editor_builders.doc_data_class_path_builder)
- )
- # Register exporters
- gen_exporters = env.CommandNoCache(
- "register_exporters.gen.cpp",
- env.Value(env.platform_exporters),
- env.Run(editor_builders.register_exporters_builder),
- )
- for e in env.platform_exporters:
- # Add all .cpp files in export folder
- env.add_source_files(env.editor_sources, f"../platform/{e}/export/*.cpp")
- # Core API documentation.
- docs = []
- docs += Glob("#doc/classes/*.xml")
- # Module API documentation.
- module_dirs = []
- for d in env.doc_class_path.values():
- if d not in module_dirs:
- module_dirs.append(d)
- for d in module_dirs:
- if not os.path.isabs(d):
- docs += Glob("#" + d + "/*.xml") # Built-in.
- else:
- docs += Glob(d + "/*.xml") # Custom.
- docs = sorted(docs)
- env.CommandNoCache(
- "#editor/doc_data_compressed.gen.h",
- docs,
- env.Run(editor_builders.make_doc_header),
- )
- # Editor interface and class reference translations incur a significant size
- # cost for the editor binary (see godot-proposals#3421).
- # To limit it, we only include translations with a high enough completion
- # ratio (20% for the editor UI, 10% for the class reference).
- # Generated with `make include-list` for each resource.
- # Editor translations
- env.CommandNoCache(
- "#editor/editor_translations.gen.h",
- Glob("#editor/translations/editor/*"),
- env.Run(editor_builders.make_translations_header),
- )
- # Property translations
- env.CommandNoCache(
- "#editor/property_translations.gen.h",
- Glob("#editor/translations/properties/*"),
- env.Run(editor_builders.make_translations_header),
- )
- # Documentation translations
- env.CommandNoCache(
- "#editor/doc_translations.gen.h",
- Glob("#doc/translations/*"),
- env.Run(editor_builders.make_translations_header),
- )
- # Extractable translations
- env.CommandNoCache(
- "#editor/extractable_translations.gen.h",
- Glob("#editor/translations/extractable/*"),
- env.Run(editor_builders.make_translations_header),
- )
- env.add_source_files(env.editor_sources, "*.cpp")
- env.add_source_files(env.editor_sources, gen_exporters)
- SConscript("debugger/SCsub")
- SConscript("export/SCsub")
- SConscript("gui/SCsub")
- SConscript("icons/SCsub")
- SConscript("import/SCsub")
- SConscript("plugins/SCsub")
- SConscript("project_manager/SCsub")
- SConscript("themes/SCsub")
- lib = env.add_library("editor", env.editor_sources)
- env.Prepend(LIBS=[lib])
|