From 9481201c2a5ee55975af0108c2da26ed681ca781 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 4 May 2024 00:44:41 +0800 Subject: improve armclang --- xmake/modules/core/tools/armclang.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/xmake/modules/core/tools/armclang.lua b/xmake/modules/core/tools/armclang.lua index dcec82015..9cc161dce 100644 --- a/xmake/modules/core/tools/armclang.lua +++ b/xmake/modules/core/tools/armclang.lua @@ -19,6 +19,7 @@ -- inherit("gcc") +import("core.language.language") function init(self) _super.init(self) @@ -30,3 +31,22 @@ function nf_runtime(self, runtime) return "-D__MICROLIB" end end + +-- make the optimize flag +function nf_optimize(self, level) + -- only for source kind + local kind = self:kind() + if language.sourcekinds()[kind] then + local maps = + { + none = "-O0" + , fast = "-O1" + , faster = "-O2" + , fastest = "-O3" + , smallest = "-Oz" -- smaller than -Os + , aggressive = "-Ofast" + } + return maps[level] + end +end + -- cgit v1.3.1