From ab6ff95d3ab6c4a141929a5c51afb1afe477f684 Mon Sep 17 00:00:00 2001 From: Thaddeus Crews Date: Fri, 26 Apr 2024 09:45:51 -0500 Subject: [PATCH] SCons: Warn when passing unknown variables --- SConstruct | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/SConstruct b/SConstruct index 3fabc4706f18..7867b61b0619 100644 --- a/SConstruct +++ b/SConstruct @@ -255,6 +255,7 @@ opts.Add(BoolVariable("scu_build", "Use single compilation unit build", False)) opts.Add("scu_limit", "Max includes per SCU file when using scu_build (determines RAM use)", "0") opts.Add(BoolVariable("engine_update_check", "Enable engine update checks in the Project Manager", True)) opts.Add(BoolVariable("steamapi", "Enable minimal SteamAPI integration for usage time tracking (editor only)", False)) +opts.Add("profile", "Path to a file containing build arguments (used in addition to root `custom.py`).", "") # Thirdparty libraries opts.Add(BoolVariable("builtin_brotli", "Use the built-in Brotli library", True)) @@ -447,6 +448,14 @@ env.modules_detected = modules_detected opts.Update(env, {**ARGUMENTS, **env.Dictionary()}) Help(opts.GenerateHelpText(env)) +# Detect and print a warning listing unknown SCons variables to ease troubleshooting. +unknown = opts.UnknownVariables() +if unknown: + print_warning( + "Unknown SCons variables were passed and will be ignored:" + + "".join([f"\n\t{key} = {value}" for key, value in unknown.items()]) + ) + # add default include paths env.Prepend(CPPPATH=["#"])