diff options
| author | ruki <[email protected]> | 2021-02-09 22:35:25 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-02-09 22:35:25 +0800 |
| commit | 630b8dabbf701ef9b490add3e6def10a74970d00 (patch) | |
| tree | 68c912ecf3cb234db3b8e6dc839895ce911a797f /xmake/modules/core/tools/cl.lua | |
| parent | 22bc93e3eac36f077583faa90f515d436e4945df (diff) | |
improve core/tools and remove os.args
Diffstat (limited to 'xmake/modules/core/tools/cl.lua')
| -rw-r--r-- | xmake/modules/core/tools/cl.lua | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua index 64d4d2773..7b7ef3f9f 100644 --- a/xmake/modules/core/tools/cl.lua +++ b/xmake/modules/core/tools/cl.lua @@ -260,9 +260,7 @@ end -- make the includedir flag function nf_includedir(self, dir) - -- @note we use os.args() to escape and wrap it, - -- because all flags will be preprocessed in `builder:_preprocess_flags`/`os.argv()` - return "-I" .. os.args(path.translate(dir)) + return {"-I", path.translate(dir)} end -- make the sysincludedir flag @@ -276,7 +274,7 @@ function nf_sysincludedir(self, dir) _g._HAS_EXTERNAL_INCLUDEDIR = has_external_includedir end if has_external_includedir then - return {"-experimental:external", "-external:W0", "-external:I" .. os.args(path.translate(dir))} + return {"-experimental:external", "-external:W0", "-external:I" .. path.translate(dir)} else return nf_includedir(self, dir) end @@ -293,9 +291,7 @@ function nf_pcheader(self, pcheaderfile, target) if objectfiles then table.insert(objectfiles, target:pcoutputfile("c") .. ".obj") end - - -- make flag - return "-Yu" .. path.filename(pcheaderfile) .. " -FI" .. path.filename(pcheaderfile) .. " -Fp" .. os.args(target:pcoutputfile("c")) + return {"-Yu" .. path.filename(pcheaderfile), "-FI" .. path.filename(pcheaderfile), "-Fp" .. target:pcoutputfile("c")} end end @@ -310,9 +306,7 @@ function nf_pcxxheader(self, pcheaderfile, target) if objectfiles then table.insert(objectfiles, target:pcoutputfile("cxx") .. ".obj") end - - -- make flag - return "-Yu" .. path.filename(pcheaderfile) .. " -FI" .. path.filename(pcheaderfile) .. " -Fp" .. os.args(target:pcoutputfile("cxx")) + return {"-Yu" .. path.filename(pcheaderfile), "-FI" .. path.filename(pcheaderfile), "-Fp" .. target:pcoutputfile("cxx")} end end @@ -388,7 +382,6 @@ function compargv(self, sourcefile, objectfile, flags, opt) end -- make the compile arguments list - -- @note only flags in nf_xxx() need be wrapped via os.args, @see nf_includedir local argv = table.join("-c", flags, "-Fo" .. objectfile, sourcefile) return self:program(), (opt and opt.rawargs) and argv or winos.cmdargv(argv) end |
