From d3f6a5c7ef552ca2ef4e35ba2eee7bd55f592a32 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 29 Dec 2022 23:25:47 +0800 Subject: add includedir for c51 #3215 --- xmake/modules/core/tools/c51.lua | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/xmake/modules/core/tools/c51.lua b/xmake/modules/core/tools/c51.lua index 1c87bbb28..c172d0bb6 100644 --- a/xmake/modules/core/tools/c51.lua +++ b/xmake/modules/core/tools/c51.lua @@ -28,6 +28,24 @@ import("utils.progress") function init(self) end +-- make the includedir flag +function nf_includedirs(self, dirs) + local paths = {} + for _, dir in ipairs(dirs) do + table.insert(paths, path.translate(dir)) + end + if #paths > 0 then + return {"INCDIR(" .. table.concat(paths, ";") .. ")"} + end +end + +-- make the define flag +function nf_defines(self, defines) + if defines and #defines > 0 then + return {"DEFINE(" .. table.concat(defines, ",") .. ")"} + end +end + -- make the compile arguments list function compargv(self, sourcefile, objectfile, flags) return self:program(), table.join(sourcefile, flags) -- cgit v1.3.1