From d9eefbd87fbec3dd99d975ce0462e4330a66bc61 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 14 Sep 2022 00:45:14 +0800 Subject: improve optimize again --- xmake/modules/core/tools/cl.lua | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'xmake/modules/core/tools/cl.lua') 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 -- cgit v1.3.1