diff options
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct index e5646a7d0a..601b2d6e80 100644 --- a/SConstruct +++ b/SConstruct @@ -4,10 +4,12 @@ EnsureSConsVersion(3, 0, 0) EnsurePythonVersion(3, 5) # System +import atexit import glob import os import pickle import sys +import time from collections import OrderedDict # Local @@ -25,6 +27,8 @@ active_platform_ids = [] platform_exporters = [] platform_apis = [] +time_at_start = time.time() + for x in sorted(glob.glob("platform/*")): if not os.path.isdir(x) or not os.path.exists(x + "/detect.py"): continue @@ -138,6 +142,7 @@ opts.Add("extra_suffix", "Custom extra suffix added to the base filename of all opts.Add(BoolVariable("vsproj", "Generate a Visual Studio solution", False)) opts.Add(BoolVariable("disable_3d", "Disable 3D nodes for a smaller executable", False)) opts.Add(BoolVariable("disable_advanced_gui", "Disable advanced GUI nodes and behaviors", False)) +opts.Add("disable_classes", "Disable given classes (comma separated)", "") opts.Add(BoolVariable("modules_enabled_by_default", "If no, disable all modules except ones explicitly enabled", True)) opts.Add(BoolVariable("no_editor_splash", "Don't use the custom splash screen for the editor", False)) opts.Add("system_certs_path", "Use this path as SSL certificates default for editor (for package maintainers)", "") @@ -638,6 +643,7 @@ if selected_platform in platform_list: if env["tools"]: env.Append(CPPDEFINES=["TOOLS_ENABLED"]) + methods.write_disabled_classes(env["disable_classes"].split(",")) if env["disable_3d"]: if env["tools"]: print( @@ -748,3 +754,12 @@ if "env" in locals(): # TODO: replace this with `env.Dump(format="json")` # once we start requiring SCons 4.0 as min version. methods.dump(env) + + +def print_elapsed_time(): + elapsed_time_sec = round(time.time() - time_at_start, 3) + time_ms = round((elapsed_time_sec % 1) * 1000) + print(f"[Time elapsed: {time.strftime('%H:%M:%S', time.gmtime(elapsed_time_sec))}.{time_ms:03}]") + + +atexit.register(print_elapsed_time) |