summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/private/action/require/impl/actions/install.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/xmake/modules/private/action/require/impl/actions/install.lua b/xmake/modules/private/action/require/impl/actions/install.lua
index abc4e9a4c..3b7a5e04e 100644
--- a/xmake/modules/private/action/require/impl/actions/install.lua
+++ b/xmake/modules/private/action/require/impl/actions/install.lua
@@ -247,12 +247,16 @@ function _merge_staticlibs(package)
end
if #libfiles > 0 then
local linkdir = linkdirs[1]
- local linkname = table.wrap(package:get("links"))[1] or package:name()
- local libfile_new = path.join(installdir, linkdir,
- target.filename(linkname, "static", {plat = package:plat(), arch = package:arch()}))
+ local linkname = package:name()
+ local opt = {plat = package:plat(), arch = package:arch()}
+ local libfile_new = path.join(installdir, linkdir, target.filename(linkname, "static", opt))
+
merge_staticlib(package, libfile_new, libfiles)
+ package:set("links", linkname)
for _, libfile in ipairs(libfiles) do
- os.rm(libfile)
+ if libfile ~= libfile_new then
+ os.rm(libfile)
+ end
end
end
end