diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-16 13:12:59 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-16 13:12:59 +0100 |
commit | 04a39ecd846f40ac1049b699291f28b2f08e2185 (patch) | |
tree | 7df0a5c21ca3c541ee75e820367ed1143e833998 | |
parent | 7c00fdcf5d915e413ae387f1f7bd7ad913a01acc (diff) | |
parent | ec3c804ea6e3ae75fc0c7debfddb1fa9f04771aa (diff) |
Merge pull request #71508 from akien-mga/fix-build-profile-env
SCons: Fix feature build profile being parsed too late
-rw-r--r-- | SConstruct | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/SConstruct b/SConstruct index 705ef43b3d..1acbd83e63 100644 --- a/SConstruct +++ b/SConstruct @@ -202,7 +202,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("build_feature_profile", "Path to a file containing a feature build profile", "") +opts.Add("build_profile", "Path to a file containing a feature build profile", "") 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", True)) opts.Add("system_certs_path", "Use this path as SSL certificates default for editor (for package maintainers)", "") @@ -492,6 +492,25 @@ if selected_platform in platform_list: env["LINKFLAGS"] = "" env.Append(LINKFLAGS=str(LINKFLAGS).split()) + # Feature build profile + disabled_classes = [] + if env["build_profile"] != "": + print("Using feature build profile: " + env["build_profile"]) + import json + + try: + ft = json.load(open(env["build_profile"])) + if "disabled_classes" in ft: + disabled_classes = ft["disabled_classes"] + if "disabled_build_options" in ft: + dbo = ft["disabled_build_options"] + for c in dbo: + env[c] = dbo[c] + except: + print("Error opening feature build profile: " + env["build_profile"]) + Exit(255) + methods.write_disabled_classes(disabled_classes) + # Platform specific flags. # These can sometimes override default options. flag_list = platform_flags[selected_platform] @@ -818,26 +837,6 @@ if selected_platform in platform_list: env["LIBSUFFIX"] = suffix + env["LIBSUFFIX"] env["SHLIBSUFFIX"] = suffix + env["SHLIBSUFFIX"] - disabled_classes = [] - - if env["build_feature_profile"] != "": - print("Using build feature profile: " + env["build_feature_profile"]) - import json - - try: - ft = json.load(open(env["build_feature_profile"])) - if "disabled_classes" in ft: - disabled_classes = ft["disabled_classes"] - if "disabled_build_options" in ft: - dbo = ft["disabled_build_options"] - for c in dbo: - env[c] = dbo[c] - except: - print("Error opening feature build profile: " + env["build_feature_profile"]) - Exit(255) - - methods.write_disabled_classes(disabled_classes) - if env["disable_3d"]: if env.editor_build: print("Build option 'disable_3d=yes' cannot be used for editor builds, but only for export templates.") |