diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-15 11:56:47 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-11-15 11:56:47 +0100 |
commit | a70431559b805ccea6500c6d01b6409492849817 (patch) | |
tree | 9b3f08be92071f102911a7d1f5e41c9fbb5eacf6 /platform | |
parent | 7fda64a849bb01483e26d99b2cb5223c00e948da (diff) | |
parent | 00d3ceb8705b9f14a332f5c6b3fe1dde8f2a9f20 (diff) |
Merge pull request #68683 from bruvzg/mvk_detect
[macOS] Automatically detect MoltenVK libs installed via homebrew and macports.
Diffstat (limited to 'platform')
-rw-r--r-- | platform/macos/detect.py | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/platform/macos/detect.py b/platform/macos/detect.py index e73c5322ea..67e4b49b14 100644 --- a/platform/macos/detect.py +++ b/platform/macos/detect.py @@ -242,18 +242,24 @@ def configure(env: "Environment"): if not env["use_volk"]: env.Append(LINKFLAGS=["-lMoltenVK"]) mvk_found = False + + mkv_list = [get_mvk_sdk_path(), "/opt/homebrew/lib", "/usr/local/homebrew/lib", "/opt/local/lib"] if env["vulkan_sdk_path"] != "": - mvk_path = os.path.join( - os.path.expanduser(env["vulkan_sdk_path"]), "MoltenVK/MoltenVK.xcframework/macos-arm64_x86_64/" + mkv_list.insert(0, os.path.expanduser(env["vulkan_sdk_path"])) + mkv_list.insert( + 0, + os.path.join( + os.path.expanduser(env["vulkan_sdk_path"]), "MoltenVK/MoltenVK.xcframework/macos-arm64_x86_64/" + ), ) - if os.path.isfile(os.path.join(mvk_path, "libMoltenVK.a")): - mvk_found = True - env.Append(LINKFLAGS=["-L" + mvk_path]) - if not mvk_found: - mvk_path = get_mvk_sdk_path() + + for mvk_path in mkv_list: if mvk_path and os.path.isfile(os.path.join(mvk_path, "libMoltenVK.a")): mvk_found = True + print("MoltenVK found at: " + mvk_path) env.Append(LINKFLAGS=["-L" + mvk_path]) + break + if not mvk_found: print( "MoltenVK SDK installation directory not found, use 'vulkan_sdk_path' SCons parameter to specify SDK path." |