diff options
| author | ruki <[email protected]> | 2020-06-20 19:48:49 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-06-20 19:48:49 +0800 |
| commit | a98aac667515d3fd59056a541199cdfe460f3d89 (patch) | |
| tree | d15db9f9c4ea68587b67fe0900c45542d168b84a /xmake/modules/core/tools/link.lua | |
| parent | 8a4d7349f8562a3cf5869dfa4a6460c049f44f3b (diff) | |
fix link args
Diffstat (limited to 'xmake/modules/core/tools/link.lua')
| -rw-r--r-- | xmake/modules/core/tools/link.lua | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/xmake/modules/core/tools/link.lua b/xmake/modules/core/tools/link.lua index 8d1f9083d..10a242e6d 100644 --- a/xmake/modules/core/tools/link.lua +++ b/xmake/modules/core/tools/link.lua @@ -29,10 +29,10 @@ function init(self) self:set("ldflags", "-nologo", "-dynamicbase", "-nxcompat") -- init arflags - self:set("arflags", "-lib", "-nologo") + self:set("arflags", "-nologo") -- init shflags - self:set("shflags", "-dll", "-nologo") + self:set("shflags", "-nologo") -- init flags map self:set("mapflags", @@ -94,7 +94,16 @@ end function linkargv(self, objectfiles, targetkind, targetfile, flags, opt) opt = opt or {} local argv = table.join(flags, "-out:" .. targetfile, objectfiles) - return self:program(), opt.rawargs and argv or winos.cmdargv(argv) + if not opt.rawargs then + argv = winos.cmdargv(argv) + end + -- @note we cannot put -lib/-dll to @args.txt + if targetkind == "static" then + table.insert(argv, 1, "-lib") + elseif targetkind == "shared" then + table.insert(argv, 1, "-dll") + end + return self:program(), argv end -- link the target file |
