summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2021-11-17 12:14:04 +0800
committerruki <[email protected]>2021-11-17 12:14:04 +0800
commitdcffc69b622da2048f6ee529f5974cb66cd6dc1a (patch)
treea7accc6ce1eb8784a39429c3ee5114926429dcff /xmake/modules
parent7f3706c2ad219d6632b3be0a4705042ced0d0233 (diff)
add microlib runtime for mdk
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/core/tools/armasm.lua7
-rw-r--r--xmake/modules/core/tools/armcc.lua7
-rw-r--r--xmake/modules/core/tools/armclang.lua7
-rw-r--r--xmake/modules/core/tools/armlink.lua7
4 files changed, 28 insertions, 0 deletions
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)