diff options
| author | ruki <[email protected]> | 2017-07-12 18:34:01 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-07-12 18:34:01 +0800 |
| commit | b72d2cd32d1919170eb621dd6c0074c975eb67e1 (patch) | |
| tree | d34c3d1fbae58091301403fd9dc450bdad78647e /xmake/modules/core/tools/ar.lua | |
| parent | 693619f971581f9b7bc66fcdb1ef65d01aa002e5 (diff) | |
modify compflags and add compargv
Diffstat (limited to 'xmake/modules/core/tools/ar.lua')
| -rw-r--r-- | xmake/modules/core/tools/ar.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/xmake/modules/core/tools/ar.lua b/xmake/modules/core/tools/ar.lua index bce088fc3..bfbc8a577 100644 --- a/xmake/modules/core/tools/ar.lua +++ b/xmake/modules/core/tools/ar.lua @@ -49,14 +49,14 @@ function strip(self, level) return maps[level] end --- make the link command -function linkcmd(self, objectfiles, targetkind, targetfile, flags) +-- make the link arguments list +function linkargv(self, objectfiles, targetkind, targetfile, flags) -- check assert(targetkind == "static") -- make it - return format("%s %s %s %s", self:program(), flags, targetfile, objectfiles) + return self:program(), table.join(flags or {}, targetfile, objectfiles) end -- link the library file @@ -69,7 +69,7 @@ function link(self, objectfiles, targetkind, targetfile, flags) os.mkdir(path.directory(targetfile)) -- link it - os.run(linkcmd(self, objectfiles, targetkind, targetfile, flags)) + os.runv(linkargv(self, objectfiles, targetkind, targetfile, flags)) end -- extract the static library to object directory @@ -85,11 +85,11 @@ function extract(self, libraryfile, objectdir) local olddir = os.cd(objectdir) -- extract it - os.run("%s -x %s", self:program(), libraryfile) + os.runv(self:program(), {"-x", libraryfile}) -- check repeat object name local repeats = {} - local objectfiles = os.iorun("%s -t %s", self:program(), libraryfile) + local objectfiles = os.iorunv(self:program(), {"-t", libraryfile}) for _, objectfile in ipairs(objectfiles:split('\n')) do if repeats[objectfile] then raise("object name(%s) conflicts in library: %s", objectfile, libraryfile) |
