summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/ml.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-06-23 22:37:44 +0800
committerGitHub <[email protected]>2020-06-23 22:37:44 +0800
commitc18d15eb89116a0f3ce96bd56f3ccf861849f6ec (patch)
tree52b63db3274349f9a41872414208c7c30058cfd7 /xmake/modules/core/tools/ml.lua
parent53df324acd9c7432336a5894ceef578daa1ce38d (diff)
parent18bded45c229f5580c13fc8b4afc5edb6f18819a (diff)
Merge pull request #857 from xmake-io/toolchain
Improve toolchain to support host and cross toolchains at same time
Diffstat (limited to 'xmake/modules/core/tools/ml.lua')
-rw-r--r--xmake/modules/core/tools/ml.lua27
1 files changed, 4 insertions, 23 deletions
diff --git a/xmake/modules/core/tools/ml.lua b/xmake/modules/core/tools/ml.lua
index 4899b46c6..3d6fb7c18 100644
--- a/xmake/modules/core/tools/ml.lua
+++ b/xmake/modules/core/tools/ml.lua
@@ -91,12 +91,12 @@ function nf_includedir(self, dir)
end
-- make the compile arguments list
-function _compargv1(self, sourcefile, objectfile, flags)
+function compargv(self, sourcefile, objectfile, flags)
return self:program(), table.join("-c", flags, "-Fo" .. os.args(objectfile), sourcefile)
end
-- compile the source file
-function _compile1(self, sourcefile, objectfile, dependinfo, flags)
+function compile(self, sourcefile, objectfile, dependinfo, flags)
-- ensure the object directory
os.mkdir(path.directory(objectfile))
@@ -105,7 +105,8 @@ function _compile1(self, sourcefile, objectfile, dependinfo, flags)
{
function ()
-- @note we need not uses vstool.runv to enable unicode output for ml.exe
- os.runv(_compargv1(self, sourcefile, objectfile, flags))
+ local program, argv = compargv(self, sourcefile, objectfile, flags)
+ os.runv(program, argv, {envs = self:runenvs()})
end,
catch
{
@@ -125,23 +126,3 @@ function _compile1(self, sourcefile, objectfile, dependinfo, flags)
}
end
--- make the compile arguments list
-function compargv(self, sourcefiles, objectfile, flags)
-
- -- only support single source file now
- assert(type(sourcefiles) ~= "table", "'object:sources' not support!")
-
- -- for only single source file
- return _compargv1(self, sourcefiles, objectfile, flags)
-end
-
--- compile the source file
-function compile(self, sourcefiles, objectfile, dependinfo, flags)
-
- -- only support single source file now
- assert(type(sourcefiles) ~= "table", "'object:sources' not support!")
-
- -- for only single source file
- _compile1(self, sourcefiles, objectfile, dependinfo, flags)
-end
-