Skip to content

Commit

Permalink
Merge pull request #3824 from SirLynix/patch-14
Browse files Browse the repository at this point in the history
Make runpath recursive on Windows
  • Loading branch information
waruqi authored Jun 9, 2023
2 parents 683c5ce + 4ebf83e commit e13615b
Showing 1 changed file with 26 additions and 16 deletions.
42 changes: 26 additions & 16 deletions xmake/modules/private/action/run/make_runenvs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,34 @@ function _make_runpath_on_windows(target)
end
end

for _, linkdir in ipairs(target:get("linkdirs")) do
insert(linkdir)
end
for _, opt in ipairs(target:orderopts()) do
for _, linkdir in ipairs(opt:get("linkdirs")) do
insert(linkdir)
end
end
for _, pkg in ipairs(target:orderpkgs()) do
for _, linkdir in ipairs(pkg:get("linkdirs")) do
insert(linkdir)
end
end
for _, dep in ipairs(target:orderdeps()) do
if dep:kind() == "shared" then
insert(dep:targetdir())
-- recursively add targets and dep targets linkdirs
local seentargets = hashset.new()
local function insert_target(target)
if seentargets:insert(target) then
for _, linkdir in ipairs(target:get("linkdirs")) do
insert(linkdir)
end
for _, opt in ipairs(target:orderopts()) do
for _, linkdir in ipairs(opt:get("linkdirs")) do
insert(linkdir)
end
end
for _, pkg in ipairs(target:orderpkgs()) do
for _, linkdir in ipairs(pkg:get("linkdirs")) do
insert(linkdir)
end
end
for _, dep in ipairs(target:orderdeps()) do
if dep:kind() == "shared" then
insert(dep:targetdir())
end
insert_target(dep)
end
end
end

insert_target(target)

return pathenv
end

Expand Down

0 comments on commit e13615b

Please sign in to comment.