diff options
| author | ruki <[email protected]> | 2022-09-14 00:45:14 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-09-14 00:45:14 +0800 |
| commit | d9eefbd87fbec3dd99d975ce0462e4330a66bc61 (patch) | |
| tree | b0643605c3f6df9c9625665012309a5263d4243a /xmake/modules/core | |
| parent | 25c5bda2b412663df909f09bcdf13e75a2102365 (diff) | |
improve optimize again
Diffstat (limited to 'xmake/modules/core')
| -rw-r--r-- | xmake/modules/core/tools/cl.lua | 22 | ||||
| -rw-r--r-- | xmake/modules/core/tools/clang_cl.lua | 25 |
2 files changed, 19 insertions, 28 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua index 177b97669..b05e35eb4 100644 --- a/xmake/modules/core/tools/cl.lua +++ b/xmake/modules/core/tools/cl.lua @@ -158,19 +158,15 @@ 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 = "-Od" - , faster = "-Ox" - , fastest = "-O2 -fp:fast" - , smallest = "-O1 -GL" -- /GL and (/OPT:REF is on by default in linker), we need enable /ltcg - , aggressive = "-O2 -fp:fast" - } - return maps[level] - end + local maps = + { + none = "-Od" + , faster = "-Ox" + , fastest = "-O2 -fp:fast" + , smallest = "-O1 -GL" -- /GL and (/OPT:REF is on by default in linker), we need enable /ltcg + , aggressive = "-O2 -fp:fast" + } + return maps[level] end -- make vs runtime flag diff --git a/xmake/modules/core/tools/clang_cl.lua b/xmake/modules/core/tools/clang_cl.lua index c67eed91a..46daa2df3 100644 --- a/xmake/modules/core/tools/clang_cl.lua +++ b/xmake/modules/core/tools/clang_cl.lua @@ -23,7 +23,6 @@ inherit("cl") import("core.base.option") import("core.base.tty") import("core.base.colors") -import("core.language.language") -- init it function init(self) @@ -93,20 +92,16 @@ 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 + local maps = + { + none = "-O0" + , fast = "-O1" + , faster = "-O2" + , fastest = "-O3" + , smallest = "-Oz" -- smaller than -Os + , aggressive = "-Ofast" + } + return maps[level] end -- compile the source file |
