summaryrefslogtreecommitdiff
path: root/xmake/plugins/pack/batchcmds.lua
diff options
context:
space:
mode:
authorSineStriker <[email protected]>2025-04-18 23:29:50 +0800
committerruki <[email protected]>2025-04-23 11:30:30 +0800
commit6551ed38c1250c0c41eada6db14f8601bf3ddb64 (patch)
treef8e7525fc8bc74b54f077c82148c0ae79df35d87 /xmake/plugins/pack/batchcmds.lua
parenta5c510f35e861b0ff71a2af0781359bc881ea3af (diff)
Support customizing `implib` path of MinGW/MSVC
Diffstat (limited to 'xmake/plugins/pack/batchcmds.lua')
-rw-r--r--xmake/plugins/pack/batchcmds.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/xmake/plugins/pack/batchcmds.lua b/xmake/plugins/pack/batchcmds.lua
index 9ed38e970..aeb1b842e 100644
--- a/xmake/plugins/pack/batchcmds.lua
+++ b/xmake/plugins/pack/batchcmds.lua
@@ -303,11 +303,13 @@ function _on_target_installcmd_shared(target, batchcmds_, opt)
-- install *.lib for shared/windows (*.dll) target
-- @see https://github.com/xmake-io/xmake/issues/714
- local targetfile = target:targetfile()
- local targetfile_lib = path.join(path.directory(targetfile), path.basename(targetfile) .. (target:is_plat("mingw") and ".dll.a" or ".lib"))
- if os.isfile(targetfile_lib) then
- batchcmds_:mkdir(libdir)
- batchcmds_:cp(targetfile_lib, path.join(libdir, path.filename(targetfile_lib)))
+ if target:is_plat("windows", "mingw") and target:is_shared() then
+ local targetfile = target:targetfile()
+ local targetfile_lib = path.join(target:implibdir(), path.basename(targetfile) .. (target:is_plat("mingw") and ".dll.a" or ".lib"))
+ if os.isfile(targetfile_lib) then
+ batchcmds_:mkdir(libdir)
+ batchcmds_:cp(targetfile_lib, path.join(libdir, path.filename(targetfile_lib)))
+ end
end
_install_target_headers(target, batchcmds_, opt)