Fix MoltenVK detection

This commit is contained in:
pohy 2024-03-09 20:21:17 +01:00
parent f28964805e
commit f65f480617
1 changed files with 9 additions and 2 deletions

View File

@ -242,10 +242,17 @@ def configure(env: "SConsEnvironment"):
env.Append(LINKFLAGS=["-framework", "Metal", "-framework", "IOSurface"])
if not env["use_volk"]:
env.Append(LINKFLAGS=["-lMoltenVK"])
mvk_path = detect_mvk(env, "macos-arm64_x86_64")
mvk_path = ""
arch_variants = ["macos-arm64_x86_64", "macos-" + env["arch"]]
for arch in arch_variants:
mvk_path = detect_mvk(env, arch)
if mvk_path != "":
mvk_path = os.path.join(mvk_path, arch)
break
if mvk_path != "":
env.Append(LINKFLAGS=["-L" + os.path.join(mvk_path, "macos-arm64_x86_64")])
env.Append(LINKFLAGS=["-L" + mvk_path])
else:
print(
"MoltenVK SDK installation directory not found, use 'vulkan_sdk_path' SCons parameter to specify SDK path."