[macOS] Automatically detect MoltenVK libs installed via homebrew and macports.
This commit is contained in:
parent
98e0d59952
commit
00d3ceb870
@ -242,18 +242,24 @@ def configure(env: "Environment"):
|
|||||||
if not env["use_volk"]:
|
if not env["use_volk"]:
|
||||||
env.Append(LINKFLAGS=["-lMoltenVK"])
|
env.Append(LINKFLAGS=["-lMoltenVK"])
|
||||||
mvk_found = False
|
mvk_found = False
|
||||||
|
|
||||||
|
mkv_list = [get_mvk_sdk_path(), "/opt/homebrew/lib", "/usr/local/homebrew/lib", "/opt/local/lib"]
|
||||||
if env["vulkan_sdk_path"] != "":
|
if env["vulkan_sdk_path"] != "":
|
||||||
mvk_path = os.path.join(
|
mkv_list.insert(0, os.path.expanduser(env["vulkan_sdk_path"]))
|
||||||
os.path.expanduser(env["vulkan_sdk_path"]), "MoltenVK/MoltenVK.xcframework/macos-arm64_x86_64/"
|
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
|
for mvk_path in mkv_list:
|
||||||
env.Append(LINKFLAGS=["-L" + mvk_path])
|
|
||||||
if not mvk_found:
|
|
||||||
mvk_path = get_mvk_sdk_path()
|
|
||||||
if mvk_path and 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
|
mvk_found = True
|
||||||
|
print("MoltenVK found at: " + mvk_path)
|
||||||
env.Append(LINKFLAGS=["-L" + mvk_path])
|
env.Append(LINKFLAGS=["-L" + mvk_path])
|
||||||
|
break
|
||||||
|
|
||||||
if not mvk_found:
|
if not mvk_found:
|
||||||
print(
|
print(
|
||||||
"MoltenVK SDK installation directory not found, use 'vulkan_sdk_path' SCons parameter to specify SDK path."
|
"MoltenVK SDK installation directory not found, use 'vulkan_sdk_path' SCons parameter to specify SDK path."
|
||||||
|
Loading…
Reference in New Issue
Block a user