diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-07-22 12:50:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-22 12:50:20 +0200 |
commit | 653f95282ccd31a4e38a157bb7845405079de371 (patch) | |
tree | fb298847cd59e899c5b2a1e00c44638d898d0c1b /SConstruct | |
parent | f37990ed77d6cf0c2b368576afe21dc574afe49f (diff) | |
parent | 6236a688b77b11de3570c94f77069049d65d25fd (diff) |
Merge pull request #62996 from reduz/feature-build-profiles
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct index 74f9d1158c..f765a26c44 100644 --- a/SConstruct +++ b/SConstruct @@ -195,7 +195,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("build_feature_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)", "") @@ -752,7 +752,27 @@ if selected_platform in platform_list: if env["tools"]: env.Append(CPPDEFINES=["TOOLS_ENABLED"]) - methods.write_disabled_classes(env["disable_classes"].split(",")) + + 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["tools"]: print( |