summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-09-20 12:09:06 +0800
committerruki <[email protected]>2020-09-20 12:11:07 +0800
commit96fe21221db328b1d3c092900d5a49ceb412f219 (patch)
tree76052db8e3c7a786066ea4983ff9a281df27e814
parentc6704add1bd642b5134f6a6eaa32a10e41f8c5c3 (diff)
improve install for windows
-rw-r--r--xmake/actions/install/install.lua11
-rw-r--r--xmake/actions/uninstall/uninstall.lua8
2 files changed, 19 insertions, 0 deletions
diff --git a/xmake/actions/install/install.lua b/xmake/actions/install/install.lua
index 44d358c5f..798d4136f 100644
--- a/xmake/actions/install/install.lua
+++ b/xmake/actions/install/install.lua
@@ -55,6 +55,17 @@ function _install_binary(target)
-- copy the target file
os.vcp(target:targetfile(), binarydir)
+
+ -- copy the dependent shared/windows (*.dll) target
+ -- @see https://github.com/xmake-io/xmake/issues/961
+ for _, dep in ipairs(target:orderdeps()) do
+ if dep:targetkind() == "shared" and is_plat("windows", "mingw") then
+ local depfile = dep:targetfile()
+ if os.isfile(depfile) then
+ os.vcp(depfile, binarydir)
+ end
+ end
+ end
end
-- install library
diff --git a/xmake/actions/uninstall/uninstall.lua b/xmake/actions/uninstall/uninstall.lua
index 2d0909f3e..3143199cd 100644
--- a/xmake/actions/uninstall/uninstall.lua
+++ b/xmake/actions/uninstall/uninstall.lua
@@ -45,6 +45,14 @@ function _uninstall_binary(target)
-- remove the target file
os.vrm(path.join(binarydir, path.filename(target:targetfile())))
+
+ -- remove the dependent shared/windows (*.dll) target
+ -- @see https://github.com/xmake-io/xmake/issues/961
+ for _, dep in ipairs(target:orderdeps()) do
+ if dep:targetkind() == "shared" and is_plat("windows", "mingw") then
+ os.vrm(path.join(binarydir, path.filename(dep:targetfile())))
+ end
+ end
end
-- uninstall library