diff options
| author | SineStriker <[email protected]> | 2025-04-18 23:29:50 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2025-04-23 11:30:30 +0800 |
| commit | 6551ed38c1250c0c41eada6db14f8601bf3ddb64 (patch) | |
| tree | f8e7525fc8bc74b54f077c82148c0ae79df35d87 /xmake/modules/core/tools/link.lua | |
| parent | a5c510f35e861b0ff71a2af0781359bc881ea3af (diff) | |
Support customizing `implib` path of MinGW/MSVC
Diffstat (limited to 'xmake/modules/core/tools/link.lua')
| -rw-r--r-- | xmake/modules/core/tools/link.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xmake/modules/core/tools/link.lua b/xmake/modules/core/tools/link.lua index 3e51ad40a..fb533eb92 100644 --- a/xmake/modules/core/tools/link.lua +++ b/xmake/modules/core/tools/link.lua @@ -137,6 +137,9 @@ function linkargv(self, objectfiles, targetkind, targetfile, flags, opt) table.insert(argv, 1, "-lib") elseif targetkind == "shared" then table.insert(argv, 1, "-dll") + if opt.target then + table.insert(argv, "/IMPLIB:" .. path.join(opt.target:implibdir(), path.basename(targetfile) .. ".lib")) + end end return self:program(), argv end @@ -147,6 +150,11 @@ 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.target and opt.target:implibdir() then + os.mkdir(opt.target:implibdir()) + end + try { function () |
