summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-09-03 23:02:23 +0800
committerruki <[email protected]>2019-09-03 12:14:18 +0800
commit4ef41f3882fe0c7391d5d0689a7fd72baca7da5d (patch)
tree64185640e17418a631fcd54c4ab19f95bd39971c
parent978bdb3c3e034afc17f29dc3688bd76a0abde801 (diff)
improve vcpkg find_package
-rw-r--r--xmake/modules/package/manager/vcpkg/find_package.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/xmake/modules/package/manager/vcpkg/find_package.lua b/xmake/modules/package/manager/vcpkg/find_package.lua
index 774d455b6..aa47e35a1 100644
--- a/xmake/modules/package/manager/vcpkg/find_package.lua
+++ b/xmake/modules/package/manager/vcpkg/find_package.lua
@@ -82,6 +82,15 @@ function main(name, opt)
table.insert(result.links, target.linkname(path.filename(line)))
end
end
+
+ -- add shared library directory (/bin/) to linkdirs for running with PATH on windows
+ if plat == "windows" and line:endswith(".dll") then
+ if line:find(plat .. (mode == "debug" and "/debug" or "") .. "/bin/", 1, true) then
+ result = result or {}
+ result.linkdirs = result.linkdirs or {}
+ table.insert(result.linkdirs, path.join(installdir, path.directory(line)))
+ end
+ end
end
end