From dcffc69b622da2048f6ee529f5974cb66cd6dc1a Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 17 Nov 2021 12:14:04 +0800 Subject: add microlib runtime for mdk --- xmake/modules/core/tools/armasm.lua | 7 +++++++ xmake/modules/core/tools/armcc.lua | 7 +++++++ xmake/modules/core/tools/armclang.lua | 7 +++++++ xmake/modules/core/tools/armlink.lua | 7 +++++++ 4 files changed, 28 insertions(+) (limited to 'xmake/modules/core') diff --git a/xmake/modules/core/tools/armasm.lua b/xmake/modules/core/tools/armasm.lua index 3065fe0a3..3ae578c55 100644 --- a/xmake/modules/core/tools/armasm.lua +++ b/xmake/modules/core/tools/armasm.lua @@ -92,6 +92,13 @@ function nf_language(self, stdname) end end +-- make runtime flag +function nf_runtime(self, runtime) + if runtime == "microlib" then + return {"--pd", "__MICROLIB SETA 1"} + end +end + -- make the define flag function nf_define(self, macro) return {"--pd", macro .. " SETA 1"} diff --git a/xmake/modules/core/tools/armcc.lua b/xmake/modules/core/tools/armcc.lua index 6215242ec..403e143f0 100644 --- a/xmake/modules/core/tools/armcc.lua +++ b/xmake/modules/core/tools/armcc.lua @@ -45,6 +45,13 @@ function nf_symbol(self, level) end end +-- make runtime flag +function nf_runtime(self, runtime) + if runtime == "microlib" then + return "-D__MICROLIB" + end +end + -- make the optimize flag function nf_optimize(self, level) local maps = diff --git a/xmake/modules/core/tools/armclang.lua b/xmake/modules/core/tools/armclang.lua index 42bec8fd5..dcec82015 100644 --- a/xmake/modules/core/tools/armclang.lua +++ b/xmake/modules/core/tools/armclang.lua @@ -23,3 +23,10 @@ inherit("gcc") function init(self) _super.init(self) end + +-- make runtime flag +function nf_runtime(self, runtime) + if runtime == "microlib" then + return "-D__MICROLIB" + end +end diff --git a/xmake/modules/core/tools/armlink.lua b/xmake/modules/core/tools/armlink.lua index 02c2b4800..e25a81967 100644 --- a/xmake/modules/core/tools/armlink.lua +++ b/xmake/modules/core/tools/armlink.lua @@ -41,6 +41,13 @@ function nf_linkdir(self, dir) return {"--userlibpath", dir} end +-- make runtime flag +function nf_runtime(self, runtime) + if runtime == "microlib" then + return "--library_type=microlib" + end +end + -- make the link arguments list function linkargv(self, objectfiles, targetkind, targetfile, flags) return self:program(), table.join("-o", targetfile, objectfiles, flags) -- cgit v1.3.1