summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/ar.lua
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/modules/core/tools/ar.lua')
-rw-r--r--xmake/modules/core/tools/ar.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/xmake/modules/core/tools/ar.lua b/xmake/modules/core/tools/ar.lua
index 57e16c9a2..650ca7b27 100644
--- a/xmake/modules/core/tools/ar.lua
+++ b/xmake/modules/core/tools/ar.lua
@@ -68,6 +68,9 @@ function link(self, objectfiles, targetkind, targetfile, flags)
-- ensure the target directory
os.mkdir(path.directory(targetfile))
+ -- @note remove the previous archived file first to force recreating a new file
+ os.tryrm(targetfile)
+
-- link it
os.runv(linkargv(self, objectfiles, targetkind, targetfile, flags))
end