diff options
| author | ruki <[email protected]> | 2019-08-20 23:52:53 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-08-20 17:17:24 +0800 |
| commit | b4aaf6ec3aa7d2d9d6f21f267a46869d25275d16 (patch) | |
| tree | 4ffca303046f223ec92a2d7938d13d4ac3622ada /xmake/modules/core/tools | |
| parent | da11852ee8510e46ba0436ab125d0d89d6c1f728 (diff) | |
rewrite vs unicode output
Diffstat (limited to 'xmake/modules/core/tools')
| -rw-r--r-- | xmake/modules/core/tools/cl.lua | 6 | ||||
| -rw-r--r-- | xmake/modules/core/tools/lib.lua | 7 | ||||
| -rw-r--r-- | xmake/modules/core/tools/link.lua | 6 | ||||
| -rw-r--r-- | xmake/modules/core/tools/ml.lua | 11 |
4 files changed, 18 insertions, 12 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua index 2d55001e3..d09a67e8e 100644 --- a/xmake/modules/core/tools/cl.lua +++ b/xmake/modules/core/tools/cl.lua @@ -22,6 +22,7 @@ import("core.base.option") import("core.project.project") import("core.language.language") +import("private.tools.vstool") -- init it function init(self) @@ -393,9 +394,8 @@ function _compile1(self, sourcefile, objectfile, dependinfo, flags) compflags = table.join(flags, "-showIncludes") end - -- compile and enable vs_unicode_output @see https://github.com/xmake-io/xmake/issues/528 - local program, argv = _compargv1(self, sourcefile, objectfile, compflags) - return os.iorunv(program, argv, {vs_unicode_output = true}) + -- use vstool to compile and enable vs_unicode_output @see https://github.com/xmake-io/xmake/issues/528 + return vstool.iorunv(_compargv1(self, sourcefile, objectfile, compflags)) end, catch { diff --git a/xmake/modules/core/tools/lib.lua b/xmake/modules/core/tools/lib.lua index 0ae9be7fd..1bd54a839 100644 --- a/xmake/modules/core/tools/lib.lua +++ b/xmake/modules/core/tools/lib.lua @@ -18,6 +18,9 @@ -- @file lib.lua -- +-- imports +import("private.tools.vstool") + -- extract the static library to object directory function extract(self, libraryfile, objectdir) @@ -25,7 +28,7 @@ function extract(self, libraryfile, objectdir) os.mkdir(objectdir) -- list object files - local objectfiles = os.iorunv(self:program(), {"-nologo", "-list", libraryfile}, {vs_unicode_output = true}) + local objectfiles = vstool.iorunv(self:program(), {"-nologo", "-list", libraryfile}) -- extrace all object files for _, objectfile in ipairs(objectfiles:split('\n')) do @@ -47,7 +50,7 @@ function extract(self, libraryfile, objectdir) end -- extract it - os.runv(self:program(), {"-nologo", "-extract:" .. objectfile, "-out:" .. outputfile, libraryfile}, {vs_unicode_output = true}) + vstool.runv(self:program(), {"-nologo", "-extract:" .. objectfile, "-out:" .. outputfile, libraryfile}) end end end diff --git a/xmake/modules/core/tools/link.lua b/xmake/modules/core/tools/link.lua index 73d9c246d..5479cb3db 100644 --- a/xmake/modules/core/tools/link.lua +++ b/xmake/modules/core/tools/link.lua @@ -20,6 +20,7 @@ -- imports import("core.project.config") +import("private.tools.vstool") -- init it function init(self) @@ -112,8 +113,7 @@ function link(self, objectfiles, targetkind, targetfile, flags, opt) -- ensure the target directory os.mkdir(path.directory(targetfile)) - -- link and enable vs_unicode_output @see https://github.com/xmake-io/xmake/issues/528 - local program, argv = linkargv(self, objectfiles, targetkind, targetfile, flags, opt) - os.runv(program, argv, {vs_unicode_output = true}) + -- use vstool to link and enable vs_unicode_output @see https://github.com/xmake-io/xmake/issues/528 + vstool.runv(linkargv(self, objectfiles, targetkind, targetfile, flags, opt)) end diff --git a/xmake/modules/core/tools/ml.lua b/xmake/modules/core/tools/ml.lua index 6eb7c529d..e14cc4e50 100644 --- a/xmake/modules/core/tools/ml.lua +++ b/xmake/modules/core/tools/ml.lua @@ -18,9 +18,13 @@ -- @file ml.lua -- --- https://docs.microsoft.com/en-us/cpp/assembler/masm/ml-and-ml64-command-line-reference +-- imports +import("private.tools.vstool") -- init it +-- +-- @see https://docs.microsoft.com/en-us/cpp/assembler/masm/ml-and-ml64-command-line-reference +-- function init(self) -- init asflags @@ -103,9 +107,8 @@ function _compile1(self, sourcefile, objectfile, dependinfo, flags) -- ensure the object directory os.mkdir(path.directory(objectfile)) - -- compile it - local program, argv = _compargv1(self, sourcefile, objectfile, flags) - os.runv(program, argv, {vs_unicode_output = true}) + -- use vstool to compile and enable vs_unicode_output @see https://github.com/xmake-io/xmake/issues/528 + vstool.runv(_compargv1(self, sourcefile, objectfile, flags)) end -- make the compile arguments list |
