1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Introduce 'drivers/apple_embedded' abstract platform for code reuse

This commit is contained in:
Ricardo Sanchez-Saez
2025-05-14 12:04:10 +01:00
parent 34f005d810
commit 457299449d
84 changed files with 6107 additions and 5411 deletions

View File

@@ -609,17 +609,33 @@ def Run(env, function):
return Action(function, "$GENCOMSTR")
def detect_darwin_toolchain_path(env):
var_name = "APPLE_TOOLCHAIN_PATH"
if not env[var_name]:
try:
xcode_path = subprocess.check_output(["xcode-select", "-p"]).strip().decode("utf-8")
if xcode_path:
env[var_name] = xcode_path + "/Toolchains/XcodeDefault.xctoolchain"
except (subprocess.CalledProcessError, OSError):
print_error("Failed to find SDK path while running 'xcode-select -p'.")
raise
def detect_darwin_sdk_path(platform, env):
sdk_name = ""
if platform == "macos":
sdk_name = "macosx"
var_name = "MACOS_SDK_PATH"
elif platform == "ios":
sdk_name = "iphoneos"
var_name = "IOS_SDK_PATH"
elif platform == "iossimulator":
sdk_name = "iphonesimulator"
var_name = "IOS_SDK_PATH"
else:
raise Exception("Invalid platform argument passed to detect_darwin_sdk_path")
@@ -629,7 +645,7 @@ def detect_darwin_sdk_path(platform, env):
if sdk_path:
env[var_name] = sdk_path
except (subprocess.CalledProcessError, OSError):
print_error("Failed to find SDK path while running xcrun --sdk {} --show-sdk-path.".format(sdk_name))
print_error("Failed to find SDK path while running 'xcrun --sdk {} --show-sdk-path'.".format(sdk_name))
raise