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: Process platform-specific flags earlier #91791

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,14 @@ if env["platform"] in platform_opts:
for opt in platform_opts[env["platform"]]:
opts.Add(opt)

# Platform-specific flags.
# These can sometimes override default options, so they need to be processed
# as early as possible to ensure that we're using the correct values.
flag_list = platform_flags[env["platform"]]
for key, value in flag_list.items():
if key not in ARGUMENTS or ARGUMENTS[key] == "auto": # Allow command line to override platform flags
env[key] = value

# Update the environment to take platform-specific options into account.
opts.Update(env, {**ARGUMENTS, **env.Dictionary()})

Expand Down Expand Up @@ -568,17 +576,8 @@ if env["build_profile"] != "":
print_error('Failed to open feature build profile: "{}"'.format(env["build_profile"]))
Exit(255)

# Platform specific flags.
# These can sometimes override default options.
flag_list = platform_flags[env["platform"]]
for key, value in flag_list.items():
if key not in ARGUMENTS or ARGUMENTS[key] == "auto": # Allow command line to override platform flags
env[key] = value

# 'dev_mode' and 'production' are aliases to set default options if they haven't been
# set manually by the user.
# These need to be checked *after* platform specific flags so that different
# default values can be set (e.g. to keep LTO off for `production` on some platforms).
if env["dev_mode"]:
env["verbose"] = methods.get_cmdline_bool("verbose", True)
env["warnings"] = ARGUMENTS.get("warnings", "extra")
Expand Down
2 changes: 1 addition & 1 deletion platform/android/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_min_target_api():

def get_flags():
return {
"arch": "arm64", # Default for convenience.
"arch": "arm64",
"target": "template_debug",
"supported": ["mono"],
}
Expand Down
2 changes: 1 addition & 1 deletion platform/ios/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def get_doc_path():

def get_flags():
return {
"arch": "arm64", # Default for convenience.
"arch": "arm64",
"target": "template_debug",
"use_volk": False,
"supported": ["mono"],
Expand Down
Loading