diff options
author | Jiri Suchan <yed@vanyli.net> | 2022-08-29 18:01:15 +0900 |
---|---|---|
committer | Jiri Suchan <yed@vanyli.net> | 2022-09-04 12:00:47 +0900 |
commit | c69b22124e64698e2f739cb2bd0235a5e627e5ba (patch) | |
tree | 673b9d142fe94b2076614a2dade34f9fb4b9e3b7 /platform/macos | |
parent | b6d102c7c2d5e9f39f368bf1ebc91a48bf762c42 (diff) |
fix: graceful exit on macOS missing Vulkan
Diffstat (limited to 'platform/macos')
-rw-r--r-- | platform/macos/detect.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/platform/macos/detect.py b/platform/macos/detect.py index e5bcb46b02..cfd3789b41 100644 --- a/platform/macos/detect.py +++ b/platform/macos/detect.py @@ -54,11 +54,13 @@ def get_mvk_sdk_path(): return [int_or_zero(i) for i in a.split(".")] dirname = os.path.expanduser("~/VulkanSDK") - files = os.listdir(dirname) + if not os.path.exists(dirname): + return "" ver_file = "0.0.0.0" ver_num = ver_parse(ver_file) + files = os.listdir(dirname) for file in files: if os.path.isdir(os.path.join(dirname, file)): ver_comp = ver_parse(file) @@ -145,7 +147,7 @@ def configure(env): env.Append(LINKFLAGS=["-isysroot", "$MACOS_SDK_PATH"]) else: # osxcross build - root = os.environ.get("OSXCROSS_ROOT", 0) + root = os.environ.get("OSXCROSS_ROOT", "") if env["arch"] == "arm64": basecmd = root + "/target/bin/arm64-apple-" + env["osxcross_sdk"] + "-" else: @@ -248,7 +250,7 @@ def configure(env): env.Append(LINKFLAGS=["-L" + mvk_path]) if not mvk_found: mvk_path = get_mvk_sdk_path() - if os.path.isfile(os.path.join(mvk_path, "libMoltenVK.a")): + if mvk_path and os.path.isfile(os.path.join(mvk_path, "libMoltenVK.a")): mvk_found = True env.Append(LINKFLAGS=["-L" + mvk_path]) if not mvk_found: |