summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/core/tools/armclang.lua20
1 files changed, 20 insertions, 0 deletions
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
+