diff options
| author | SineStriker <[email protected]> | 2025-04-20 05:07:38 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-04-23 11:30:30 +0800 |
| commit | d57cceb19f58b99d5198cea0c32ec306ea22a9fb (patch) | |
| tree | 74f5b5cd3f707887b35fea49e6621dd1ee5b34d7 /xmake/modules/core/tools/nvcc.lua | |
| parent | cef17b4c566a186ba8e9dd3dc52ab44901fed9f1 (diff) | |
Add `set_implibdir` to target APIs
Diffstat (limited to 'xmake/modules/core/tools/nvcc.lua')
| -rw-r--r-- | xmake/modules/core/tools/nvcc.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua index 58d614fbd..ec0e15874 100644 --- a/xmake/modules/core/tools/nvcc.lua +++ b/xmake/modules/core/tools/nvcc.lua @@ -288,9 +288,9 @@ 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) + local implib = opt.implib or path.join(path.directory(targetfile), path.basename(targetfile) .. ".dll.a") table.insert(flags_extra, "-Xlinker") - table.insert(flags_extra, "-Wl,--out-implib," .. path.join(implibdir, path.basename(targetfile) .. ".dll.a")) + table.insert(flags_extra, "-Wl,--out-implib," .. implib) end -- make link args @@ -299,11 +299,13 @@ end -- link the target file function link(self, objectfiles, targetkind, targetfile, flags, opt) + + -- ensure the target directory os.mkdir(path.directory(targetfile)) -- ensure the implib directory - if opt and opt.implibdir then - os.mkdir(opt.implibdir) + if opt and opt.implib then + os.mkdir(path.directory(opt.implib)) end local program, argv = linkargv(self, objectfiles, targetkind, targetfile, flags, opt) |
