From 4ef41f3882fe0c7391d5d0689a7fd72baca7da5d Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 3 Sep 2019 23:02:23 +0800 Subject: improve vcpkg find_package --- xmake/modules/package/manager/vcpkg/find_package.lua | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- cgit v1.3.1