You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-19 14:31:59 +00:00
Add Metal support for macOS (arm64) and iOS
This commit is contained in:
committed by
Rémi Verschelde
parent
826de7976a
commit
2d0165574d
@@ -51,6 +51,7 @@ def get_flags():
|
||||
"arch": "arm64",
|
||||
"target": "template_debug",
|
||||
"use_volk": False,
|
||||
"metal": True,
|
||||
"supported": ["mono"],
|
||||
"builtin_pcre2_with_jit": False,
|
||||
}
|
||||
@@ -154,8 +155,22 @@ def configure(env: "SConsEnvironment"):
|
||||
env.Prepend(CPPPATH=["#platform/ios"])
|
||||
env.Append(CPPDEFINES=["IOS_ENABLED", "UNIX_ENABLED", "COREAUDIO_ENABLED"])
|
||||
|
||||
if env["metal"] and env["arch"] != "arm64":
|
||||
# Only supported on arm64, so skip it for x86_64 builds.
|
||||
env["metal"] = False
|
||||
|
||||
if env["metal"]:
|
||||
env.AppendUnique(CPPDEFINES=["METAL_ENABLED", "RD_ENABLED"])
|
||||
env.Prepend(
|
||||
CPPPATH=[
|
||||
"$IOS_SDK_PATH/System/Library/Frameworks/Metal.framework/Headers",
|
||||
"$IOS_SDK_PATH/System/Library/Frameworks/QuartzCore.framework/Headers",
|
||||
]
|
||||
)
|
||||
env.Prepend(CPPPATH=["#thirdparty/spirv-cross"])
|
||||
|
||||
if env["vulkan"]:
|
||||
env.Append(CPPDEFINES=["VULKAN_ENABLED", "RD_ENABLED"])
|
||||
env.AppendUnique(CPPDEFINES=["VULKAN_ENABLED", "RD_ENABLED"])
|
||||
|
||||
if env["opengl3"]:
|
||||
env.Append(CPPDEFINES=["GLES3_ENABLED", "GLES_SILENCE_DEPRECATION"])
|
||||
|
||||
Reference in New Issue
Block a user