diff --git a/SConstruct b/SConstruct index b23421579..7782b2acc 100644 --- a/SConstruct +++ b/SConstruct @@ -166,6 +166,7 @@ opts.Add( ("pointers", "handles", "tracked_handles"), ) ) +opts.Add(BoolVariable("editor_docs", "Whether to add docs to an editor build or not. Disabling this can significantly reduce incremental compile times. Only relevant for editor builds!", True)) # Thirdparty libraries opts.Add(BoolVariable("builtin_certs", "Use the built-in SSL certificates bundles", True)) diff --git a/editor/SCsub b/editor/SCsub index 1407d40a1..6718e3b7f 100644 --- a/editor/SCsub +++ b/editor/SCsub @@ -46,23 +46,26 @@ if env["tools"]: # 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) + if env["editor_docs"]: + docs += Glob("#doc/classes/*.xml") - for d in module_dirs: - if not os.path.isabs(d): - docs += Glob("#" + d + "/*.xml") # Built-in. - else: - docs += Glob(d + "/*.xml") # Custom. + # Module API documentation. + module_dirs = [] + for d in env.doc_class_path.values(): + if d not in module_dirs: + module_dirs.append(d) - _make_doc_data_class_path(env.Dir("#editor/doc").abspath) + for d in module_dirs: + if not os.path.isabs(d): + docs += Glob("#" + d + "/*.xml") # Built-in. + else: + docs += Glob(d + "/*.xml") # Custom. + + _make_doc_data_class_path(env.Dir("#editor/doc").abspath) + + docs = sorted(docs) - docs = sorted(docs) env.Depends("#editor/doc_data_compressed.gen.h", docs) env.CommandNoCache("#editor/doc_data_compressed.gen.h", docs, run_in_subprocess(editor_builders.make_doc_header))