summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/core/tools/cl.lua22
-rw-r--r--xmake/modules/core/tools/clang_cl.lua25
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