Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix vulkansdk searching for mingw platform #5549

Merged
merged 2 commits into from
Aug 31, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion xmake/modules/detect/sdks/find_vulkansdk.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ import("lib.detect.find_package")
function _find_vulkan_from_paths(paths, opt)
opt = opt or {}
local arch = opt.arch or config.arch() or os.arch()
local plat = opt.plat or config.get("plat") or os.host()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use config.plat()

local binsuffix = ((is_host("windows") and arch == "x86") and "bin32" or "bin")
local libname = (is_host("windows") and "vulkan-1" or "vulkan")
local libsuffix = ((is_host("windows") and arch == "x86") and "lib32" or "lib")

-- find library
local result = {links = {}, linkdirs = {}, includedirs = {}}
local linkinfo = find_library(libname, paths, {suffixes = {libsuffix}})
local linkinfo = find_library(libname, paths, {suffixes = {libsuffix}, plat = plat})
if linkinfo then
result.sdkdir = path.directory(linkinfo.linkdir)
result.bindir = path.join(result.sdkdir, binsuffix)
Expand Down
Loading