diff options
| author | ruki <[email protected]> | 2024-05-04 00:44:41 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2024-05-04 00:44:41 +0800 |
| commit | 9481201c2a5ee55975af0108c2da26ed681ca781 (patch) | |
| tree | 6779c605d61231aa293215d67bde9124d153fb86 | |
| parent | c2f2ad5d2818eeefc487896d673c2585829108bf (diff) | |
improve armclang
| -rw-r--r-- | xmake/modules/core/tools/armclang.lua | 20 |
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 + |
