summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/gcc.lua
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/core/tools/gcc.lua
parentcef17b4c566a186ba8e9dd3dc52ab44901fed9f1 (diff)
Add `set_implibdir` to target APIs
Diffstat (limited to 'xmake/modules/core/tools/gcc.lua')
-rw-r--r--xmake/modules/core/tools/gcc.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 48e2ebe73..e59898efa 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -575,8 +575,8 @@ function linkargv(self, objectfiles, targetkind, targetfile, flags, opt)
-- add `-Wl,--out-implib,outputdir/libxxx.a` for xxx.dll on mingw/gcc
if targetkind == "shared" and self:is_plat("mingw") then
- local implibdir = opt.implibdir or path.directory(targetfile)
- table.insert(flags_extra, "-Wl,--out-implib," .. path.join(implibdir, path.basename(targetfile) .. ".dll.a"))
+ local implib = opt.implib or path.join(path.directory(targetfile), path.basename(targetfile) .. ".dll.a")
+ table.insert(flags_extra, "-Wl,--out-implib," .. implib)
end
-- init arguments
@@ -595,11 +595,13 @@ end
--
function link(self, objectfiles, targetkind, targetfile, flags, opt)
opt = opt or {}
+
+ -- ensure the target directory
os.mkdir(path.directory(targetfile))
-- ensure the implib directory
- if opt.implibdir then
- os.mkdir(opt.implibdir)
+ if opt.implib then
+ os.mkdir(path.directory(opt.implib))
end
local program, argv = linkargv(self, objectfiles, targetkind, targetfile, flags, opt)