diff options
| author | ruki <[email protected]> | 2021-09-02 23:34:28 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-09-02 23:34:28 +0800 |
| commit | b47154e928d5fa960365a205420912ae1363ba53 (patch) | |
| tree | 53d42d5a36a0391fd78a09f69503ca44bb1ee3a2 /xmake/modules/core/tools/fpc.lua | |
| parent | ae7c9e6398f72b314d6601a324d5fbf3829c547b (diff) | |
use build mode for fpc
Diffstat (limited to 'xmake/modules/core/tools/fpc.lua')
| -rw-r--r-- | xmake/modules/core/tools/fpc.lua | 47 |
1 files changed, 9 insertions, 38 deletions
diff --git a/xmake/modules/core/tools/fpc.lua b/xmake/modules/core/tools/fpc.lua index b83fd6ea8..65662de4c 100644 --- a/xmake/modules/core/tools/fpc.lua +++ b/xmake/modules/core/tools/fpc.lua @@ -22,61 +22,32 @@ import("core.base.option") import("core.project.config") import("core.project.project") -import("core.project.target") -- init it function init(self) end --- make the strip flag -function nf_strip(self, level) -end - --- make the define flag -function nf_define(self, macro) - return "-D" .. macro -end - -- make the optimize flag function nf_optimize(self, level) end --- make the link flag -function nf_link(self, lib) - return "-l" .. lib -end - --- make the syslink flag -function nf_syslink(self, lib) - return nf_link(self, lib) +-- make the symbol flag +function nf_symbol(self, level) end -- make the linkdir flag function nf_linkdir(self, dir) - return {"-L", dir} + return {"-L" .. dir} end --- make the link arguments list -function linkargv(self, objectfiles, targetkind, targetfile, flags) - local argv = {} - return self:program(), argv +-- make the build arguments list +function buildargv(self, sourcefiles, targetkind, targetfile, flags) + return self:program(), table.join(flags, "-o" .. targetfile, sourcefiles) end --- link the target file -function link(self, objectfiles, targetkind, targetfile, flags) +-- build the target file +function build(self, sourcefiles, targetkind, targetfile, flags) os.mkdir(path.directory(targetfile)) - os.runv(linkargv(self, objectfiles, targetkind, targetfile, flags)) -end - --- make the compile arguments list -function compargv(self, sourcefile, objectfile, flags) - return self:program(), table.join("-Sd", "-Cn", flags, "-FE" .. path.directory(objectfile), sourcefile) -end - --- compile the source file -function compile(self, sourcefile, objectfile, dependinfo, flags) - os.mkdir(path.directory(objectfile)) - os.runv(compargv(self, sourcefile, objectfile, flags)) - os.mv(path.join(path.directory(objectfile), path.basename(sourcefile) .. ".o"), objectfile) + os.runv(buildargv(self, sourcefiles, targetkind, targetfile, flags)) end |
