Buildsystem: Unify compatibility aliases

Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
This commit is contained in:
Yevhen Babiichuk (DustDFG) 2024-11-11 08:05:02 +02:00
parent 0f5f3bc954
commit 1901466d0d
2 changed files with 16 additions and 20 deletions

View File

@ -59,7 +59,7 @@ import glsl_builders
import methods import methods
import scu_builders import scu_builders
from methods import print_error, print_warning from methods import print_error, print_warning
from platform_methods import architecture_aliases, architectures from platform_methods import architecture_aliases, architectures, compatibility_platform_aliases
if ARGUMENTS.get("target", "editor") == "editor": if ARGUMENTS.get("target", "editor") == "editor":
_helper_module("editor.editor_builders", "editor/editor_builders.py") _helper_module("editor.editor_builders", "editor/editor_builders.py")
@ -350,28 +350,17 @@ if env["platform"] == "":
if env["platform"] != "": if env["platform"] != "":
print(f'Automatically detected platform: {env["platform"]}') print(f'Automatically detected platform: {env["platform"]}')
if env["platform"] == "osx": # Deprecated aliases kept for compatibility.
# Deprecated alias kept for compatibility. if env["platform"] in compatibility_platform_aliases:
print_warning('Platform "osx" has been renamed to "macos" in Godot 4. Building for platform "macos".') alias = env["platform"]
env["platform"] = "macos" platform = compatibility_platform_aliases[alias]
print_warning(f'Platform "{alias}" has been renamed to "{platform}" in Godot 4. Building for platform "{platform}".')
env["platform"] = platform
if env["platform"] == "iphone": # Alias for convenience.
# Deprecated alias kept for compatibility. if env["platform"] in ["linux", "bsd"]:
print_warning('Platform "iphone" has been renamed to "ios" in Godot 4. Building for platform "ios".')
env["platform"] = "ios"
if env["platform"] in ["linux", "bsd", "x11"]:
if env["platform"] == "x11":
# Deprecated alias kept for compatibility.
print_warning('Platform "x11" has been renamed to "linuxbsd" in Godot 4. Building for platform "linuxbsd".')
# Alias for convenience.
env["platform"] = "linuxbsd" env["platform"] = "linuxbsd"
if env["platform"] == "javascript":
# Deprecated alias kept for compatibility.
print_warning('Platform "javascript" has been renamed to "web" in Godot 4. Building for platform "web".')
env["platform"] = "web"
if env["platform"] not in platform_list: if env["platform"] not in platform_list:
text = "The following platforms are available:\n\t{}\n".format("\n\t".join(platform_list)) text = "The following platforms are available:\n\t{}\n".format("\n\t".join(platform_list))
text += "Please run SCons again and select a valid platform: platform=<string>." text += "Please run SCons again and select a valid platform: platform=<string>."

View File

@ -8,6 +8,13 @@ import methods
# NOTE: The multiprocessing module is not compatible with SCons due to conflict on cPickle # NOTE: The multiprocessing module is not compatible with SCons due to conflict on cPickle
compatibility_platform_aliases = {
"osx": "macos",
"iphone": "ios",
"x11": "linuxbsd",
"javascript": "web",
}
# CPU architecture options. # CPU architecture options.
architectures = ["x86_32", "x86_64", "arm32", "arm64", "rv64", "ppc32", "ppc64", "wasm32"] architectures = ["x86_32", "x86_64", "arm32", "arm64", "rv64", "ppc32", "ppc64", "wasm32"]
architecture_aliases = { architecture_aliases = {