summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack <[email protected]>2022-12-30 21:39:48 +0800
committerJack <[email protected]>2022-12-30 21:39:48 +0800
commite71cb70e55d3b6a9cf3521744ed48cf0f0c02fca (patch)
treea56aead281b8c30bb659b7f548d931275ca9bd37
parent2c4d597e6c25f5212d9f410a4edd0c62d03629d3 (diff)
Implement suggestions from second round of code review
-rw-r--r--xmake/modules/core/tools/bl51.lua2
-rw-r--r--xmake/modules/core/tools/c51.lua18
2 files changed, 4 insertions, 16 deletions
diff --git a/xmake/modules/core/tools/bl51.lua b/xmake/modules/core/tools/bl51.lua
index aed92c01c..075a0289c 100644
--- a/xmake/modules/core/tools/bl51.lua
+++ b/xmake/modules/core/tools/bl51.lua
@@ -28,7 +28,7 @@ end
-- make the link arguments list
function linkargv(self, objectfiles, targetkind, targetfile, flags)
- return self:program(), table.join(table.concat(objectfiles,","), "TO", targetfile)
+ return self:program(), table.join(table.concat(objectfiles, ","), "TO", targetfile)
end
-- link the target file
diff --git a/xmake/modules/core/tools/c51.lua b/xmake/modules/core/tools/c51.lua
index 4c4696a78..469fa96fa 100644
--- a/xmake/modules/core/tools/c51.lua
+++ b/xmake/modules/core/tools/c51.lua
@@ -28,16 +28,9 @@ import("utils.progress")
function init(self)
end
---[[
-The flags variable in the compile function is empty when you run the command `xmake -r`.
-But The `xmake -rv` command is no problem.
-Use these ways to walk around first.
---]]
-local paths = {}
-
-- make the includedir flag
function nf_includedirs(self, dirs)
- --local paths = {}
+ local paths = {}
for _, dir in ipairs(dirs) do
table.insert(paths, path.translate(dir))
end
@@ -55,12 +48,7 @@ end
-- make the compile arguments list
function compargv(self, sourcefile, objectfile, flags)
- table.insert(flags, "OBJECT(" .. objectfile .. ")")
- table.insert(flags, "PRINT(" .. objectfile:gsub(".c.obj", ".lst") .. ")")
- if #paths > 0 then
- table.insert(flags, "INCDIR(" .. table.concat(paths, ";") .. ")")
- end
- return self:program(), table.join(sourcefile, flags)
+ return self:program(), table.join(sourcefile, "OBJECT(" .. objectfile .. ")", "PRINT(" .. (objectfile:gsub("%.c%.obj", ".lst")) .. ")", flags)
end
-- compile the source file
@@ -72,7 +60,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags)
try
{
function ()
- local outdata, errdata = os.iorunv(compargv(self, sourcefile, objectfile, dependinfo, flags))
+ local outdata, errdata = os.iorunv(compargv(self, sourcefile, objectfile, flags))
return (outdata or "") .. (errdata or "")
end,
catch