summaryrefslogtreecommitdiff
path: root/xmake/modules/target/action
diff options
context:
space:
mode:
authorSineStriker <[email protected]>2025-04-20 05:07:38 +0800
committerruki <[email protected]>2025-04-23 11:30:30 +0800
commitd57cceb19f58b99d5198cea0c32ec306ea22a9fb (patch)
tree74f5b5cd3f707887b35fea49e6621dd1ee5b34d7 /xmake/modules/target/action
parentcef17b4c566a186ba8e9dd3dc52ab44901fed9f1 (diff)
Add `set_implibdir` to target APIs
Diffstat (limited to 'xmake/modules/target/action')
-rw-r--r--xmake/modules/target/action/clean/main.lua12
-rw-r--r--xmake/modules/target/action/install/main.lua6
2 files changed, 8 insertions, 10 deletions
diff --git a/xmake/modules/target/action/clean/main.lua b/xmake/modules/target/action/clean/main.lua
index 911fbe17e..98773a9ab 100644
--- a/xmake/modules/target/action/clean/main.lua
+++ b/xmake/modules/target/action/clean/main.lua
@@ -40,16 +40,14 @@ function main(target)
if target:is_shared() then
if target:is_plat("windows") then
local expfile = path.join(target:implibdir(), path.basename(targetfile) .. ".exp")
- local libfile = path.join(target:implibdir(), path.basename(targetfile) .. ".lib")
if os.isfile(expfile) then
- remove_files(libfile)
remove_files(expfile)
end
- elseif target:is_plat("mingw") then
- local libfile = path.join(target:implibdir(), path.basename(targetfile) .. ".dll.a")
- if os.isfile(libfile) then
- remove_files(libfile)
- end
+ end
+
+ local implibfile = target:implibfile()
+ if implibfile and os.isfile(implibfile) then
+ remove_files(implibfile)
end
end
diff --git a/xmake/modules/target/action/install/main.lua b/xmake/modules/target/action/install/main.lua
index d60426b0a..9fb90b1fe 100644
--- a/xmake/modules/target/action/install/main.lua
+++ b/xmake/modules/target/action/install/main.lua
@@ -237,10 +237,10 @@ function _install_shared(target, opt)
-- @see https://github.com/xmake-io/xmake/issues/714
os.vcp(target:targetfile(), bindir)
local libdir = _get_target_libdir(target, opt)
- 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
+ local target_implib = target:implibfile()
+ if os.isfile(target_implib) then
os.mkdir(libdir)
- os.vcp(targetfile_lib, libdir)
+ os.vcp(target_implib, libdir)
end
else
-- install target with soname and symlink