diff options
| author | ruki <[email protected]> | 2018-07-06 22:43:37 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-07-06 10:21:45 +0800 |
| commit | ae821292c473db2f13106e7e3e86be57950a1cfd (patch) | |
| tree | 80e30ea507701f86ddf643af6558ece197f2f6c6 /xmake/modules/core/tools | |
| parent | 3f353a69940ab45a9e0bf65369d82ee704f46da6 (diff) | |
improve smallest compile option for clang
Diffstat (limited to 'xmake/modules/core/tools')
| -rw-r--r-- | xmake/modules/core/tools/clang.lua | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/xmake/modules/core/tools/clang.lua b/xmake/modules/core/tools/clang.lua index 692fc559c..67b271da6 100644 --- a/xmake/modules/core/tools/clang.lua +++ b/xmake/modules/core/tools/clang.lua @@ -36,3 +36,21 @@ function init(self) _super._g.mxflags = {"-Qunused-arguments"} _super._g.asflags = {"-Qunused-arguments"} end + +-- make the optimize flag +function nf_optimize(self, level) + + -- the maps + local maps = + { + none = "-O0" + , fast = "-O1" + , faster = "-O2" + , fastest = "-O3" + , smallest = "-Oz" -- smaller than -Os + , aggressive = "-Ofast" + } + + -- make it + return maps[level] +end |
