diff options
author | Yuri Sizov <11782833+YuriSizov@users.noreply.github.com> | 2024-01-17 19:20:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-17 19:20:26 +0100 |
commit | 96296e476ffda2d4c36680b2271e9eeff0c3b9f8 (patch) | |
tree | 92e0bca98cc9a4d4a58cb529ce255992b841f6cf | |
parent | 44013b88eb448b4fcf9a9004b6100e127d27adea (diff) | |
parent | a2c1c01941a3dec3e2a361d9dc21bb0390efcbaf (diff) | |
download | redot-engine-96296e476ffda2d4c36680b2271e9eeff0c3b9f8.tar.gz |
Merge pull request #87305 from bruvzg/mvk_detect_new
[macOS] Fix MoltenVK SDK detection after file location changes in 1.3.275.0.
-rw-r--r-- | platform/macos/detect.py | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/platform/macos/detect.py b/platform/macos/detect.py index 12db2690de..bc14d233bb 100644 --- a/platform/macos/detect.py +++ b/platform/macos/detect.py @@ -67,21 +67,30 @@ def get_mvk_sdk_path(): if not os.path.exists(dirname): return "" - ver_file = "0.0.0.0" - ver_num = ver_parse(ver_file) - + ver_num = ver_parse("0.0.0.0") files = os.listdir(dirname) + lib_name_out = dirname for file in files: if os.path.isdir(os.path.join(dirname, file)): ver_comp = ver_parse(file) - lib_name = os.path.join( - os.path.join(dirname, file), "MoltenVK/MoltenVK.xcframework/macos-arm64_x86_64/libMoltenVK.a" - ) - if os.path.isfile(lib_name) and ver_comp > ver_num: - ver_num = ver_comp - ver_file = file + if ver_comp > ver_num: + # Try new SDK location. + lib_name = os.path.join( + os.path.join(dirname, file), "macOS/lib/MoltenVK.xcframework/macos-arm64_x86_64/" + ) + if os.path.isfile(os.path.join(lib_name, "libMoltenVK.a")): + ver_num = ver_comp + lib_name_out = lib_name + else: + # Try old SDK location. + lib_name = os.path.join( + os.path.join(dirname, file), "MoltenVK/MoltenVK.xcframework/macos-arm64_x86_64/" + ) + if os.path.isfile(os.path.join(lib_name, "libMoltenVK.a")): + ver_num = ver_comp + lib_name_out = lib_name - return os.path.join(os.path.join(dirname, ver_file), "MoltenVK/MoltenVK.xcframework/macos-arm64_x86_64/") + return lib_name_out def configure(env: "Environment"): @@ -272,6 +281,12 @@ def configure(env: "Environment"): mvk_list.insert( 0, os.path.join( + os.path.expanduser(env["vulkan_sdk_path"]), "macOS/lib/MoltenVK.xcframework/macos-arm64_x86_64/" + ), + ) + mvk_list.insert( + 0, + os.path.join( os.path.expanduser(env["vulkan_sdk_path"]), "MoltenVK/MoltenVK.xcframework/macos-arm64_x86_64/" ), ) |