summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/cl.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-12-24 22:53:35 +0800
committerruki <[email protected]>2020-12-24 22:53:35 +0800
commit5beced53d4ba81070c79a777ac5f5f0233e22e4e (patch)
treeb2c6aa0654e0e68a2a40dc2870928551539b9805 /xmake/modules/core/tools/cl.lua
parent381e3c74967cfab1c5d42e9ee7fcb68a5a1533f7 (diff)
add vs_runtime config and set_runtimes api
Diffstat (limited to 'xmake/modules/core/tools/cl.lua')
-rw-r--r--xmake/modules/core/tools/cl.lua19
1 files changed, 7 insertions, 12 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index ba9e82d84..64d4d2773 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -142,8 +142,6 @@ end
-- make the warning flag
function nf_warning(self, level)
-
- -- the maps
local maps =
{
none = "-W0"
@@ -154,15 +152,11 @@ function nf_warning(self, level)
, everything = "-Wall"
, error = "-WX"
}
-
- -- make it
return maps[level]
end
-- make the optimize flag
function nf_optimize(self, level)
-
- -- the maps
local maps =
{
none = "-Od"
@@ -171,15 +165,18 @@ function nf_optimize(self, level)
, smallest = "-O1 -GL" -- /GL and (/OPT:REF is on by default in linker), we need enable /ltcg
, aggressive = "-Ox -fp:fast"
}
-
- -- make it
return maps[level]
end
+-- make vs runtime flag
+function nf_runtime(self, vs_runtime)
+ if vs_runtime then
+ return "-" .. vs_runtime
+ end
+end
+
-- make the vector extension flag
function nf_vectorext(self, extension)
-
- -- the maps
local maps =
{
sse = "-arch:SSE"
@@ -187,8 +184,6 @@ function nf_vectorext(self, extension)
, avx = "-arch:AVX"
, avx2 = "-arch:AVX2"
}
-
- -- check it
local flag = maps[extension]
if flag and self:has_flags(flag, "cxflags") then
return flag