diff options
| author | ruki <[email protected]> | 2022-12-30 21:48:35 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-12-30 21:48:35 +0800 |
| commit | ff4fb0bbf49a490bfe51dcb29b7d02a82350ad63 (patch) | |
| tree | d8522a411497a0e28aa0a966612cd1327efc269f | |
| parent | d1ef852ee0c6aeebac5ed7456f19f6793f00254d (diff) | |
| parent | e71cb70e55d3b6a9cf3521744ed48cf0f0c02fca (diff) | |
Merge pull request #3227 from lanjackg2003/fix/c51-compile-issues
Fix/c51 compile issues
| -rw-r--r-- | xmake/modules/core/tools/bl51.lua | 2 | ||||
| -rw-r--r-- | xmake/modules/core/tools/c51.lua | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/xmake/modules/core/tools/bl51.lua b/xmake/modules/core/tools/bl51.lua index 70c04385b..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(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 c172d0bb6..469fa96fa 100644 --- a/xmake/modules/core/tools/c51.lua +++ b/xmake/modules/core/tools/c51.lua @@ -48,7 +48,7 @@ end -- make the compile arguments list function compargv(self, sourcefile, objectfile, flags) - 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 @@ -56,14 +56,11 @@ function compile(self, sourcefile, objectfile, dependinfo, flags) -- ensure the object directory os.mkdir(path.directory(objectfile)) - -- compile it try { function () - local realsourcefile = objectfile:gsub("\\.obj$", "") - os.cp(sourcefile, realsourcefile) - local outdata, errdata = os.iorunv(compargv(self, realsourcefile, objectfile, dependinfo, flags)) + local outdata, errdata = os.iorunv(compargv(self, sourcefile, objectfile, flags)) return (outdata or "") .. (errdata or "") end, catch |
