Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCons: Fix feature build profile being parsed too late (renames option to build_profile) #71508

Merged
merged 1 commit into from Jan 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 20 additions & 21 deletions SConstruct
Expand Up @@ -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)", "")
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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.")
Expand Down