From d57cceb19f58b99d5198cea0c32ec306ea22a9fb Mon Sep 17 00:00:00 2001 From: SineStriker <55847490+SineStriker@users.noreply.github.com> Date: Sun, 20 Apr 2025 05:07:38 +0800 Subject: Add `set_implibdir` to target APIs --- xmake/plugins/pack/batchcmds.lua | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'xmake/plugins/pack/batchcmds.lua') diff --git a/xmake/plugins/pack/batchcmds.lua b/xmake/plugins/pack/batchcmds.lua index aeb1b842e..70d8e2f5f 100644 --- a/xmake/plugins/pack/batchcmds.lua +++ b/xmake/plugins/pack/batchcmds.lua @@ -303,13 +303,10 @@ function _on_target_installcmd_shared(target, batchcmds_, opt) -- install *.lib for shared/windows (*.dll) target -- @see https://github.com/xmake-io/xmake/issues/714 - 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 + local target_implib = target:implibfile() + if target_implib and os.isfile(target_implib) then + batchcmds_:mkdir(libdir) + batchcmds_:cp(target_implib, path.join(libdir, path.filename(target_implib))) end _install_target_headers(target, batchcmds_, opt) -- cgit v1.3.1