From afc171a4a40130215b833941ee5b7b7de4f042c0 Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 16 Nov 2022 12:56:01 +0100 Subject: [PATCH] Added a new editor_docs setting to the build. Disabling it can help when quick iteration times are desired. Setting it to false saves about 4 seconds of compile time for me (in the current stripped slim build that I'm working on). --- SConstruct | 1 + editor/SCsub | 29 ++++++++++++++++------------- 2 files changed, 17 insertions(+), 13 deletions(-) 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))