Skip to content

Commit

Permalink
fix nuget links xmake-io#6082
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Jan 16, 2025
1 parent dd67d6e commit 2bf33a0
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions xmake/modules/package/manager/nuget/find_package.lua
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,18 @@ function _find_package(name, result, opt)

-- get linkdirs and links
if file:endswith(".lib") then
local libfile = path.unix(path.join(libdir, libarch, toolset, libmode, runtime))
if file:startswith(libfile .. "/") then
result.links = result.links or {}
result.linkdirs = result.linkdirs or {}
result.libfiles = result.libfiles or {}
table.insert(result.linkdirs, path.directory(filepath))
table.insert(result.links, target.linkname(path.filename(filepath), {plat = plat}))
table.insert(result.libfiles, filepath)
local searchdirs = {}
table.insert(searchdirs, path.unix(path.join(libdir, libarch, toolset, libmode, runtime)))
table.insert(searchdirs, path.unix(path.join(libdir, libarch)))
for _, searchdir in ipairs(searchdirs) do
if file:startswith(searchdir .. "/") then
result.links = result.links or {}
result.linkdirs = result.linkdirs or {}
result.libfiles = result.libfiles or {}
table.insert(result.linkdirs, path.directory(filepath))
table.insert(result.links, target.linkname(path.filename(filepath), {plat = plat}))
table.insert(result.libfiles, filepath)
end
end
end
end
Expand Down

0 comments on commit 2bf33a0

Please sign in to comment.