summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/cl.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-09-27 23:15:13 +0800
committerruki <[email protected]>2021-09-27 23:15:13 +0800
commit19b2916a1e97e5c5fb2965cab9b6b4aecd1e03b4 (patch)
tree6488593d622daeb01582408cdb685cac000abaa4 /xmake/modules/core/tools/cl.lua
parent130d0f14a97915934eb2e82fda05b25ca7f7284f (diff)
improve languages
Diffstat (limited to 'xmake/modules/core/tools/cl.lua')
-rw-r--r--xmake/modules/core/tools/cl.lua17
1 files changed, 10 insertions, 7 deletions
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index 0cad0abd6..54eafe227 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -203,8 +203,8 @@ function nf_language(self, stdname)
, gnu11 = {"-std:c11", "-TP"}
, c17 = {"-std:c17", "-TP"}
, gnu17 = {"-std:c17", "-TP"}
- , clatest = "-std:c17"
- , gnulatest = "-std:c17"
+ , clatest = {"-std:c17", "-std:c11"}
+ , gnulatest = {"-std:c17", "-std:c11"}
}
end
@@ -241,14 +241,17 @@ function nf_language(self, stdname)
end
-- map it
- local flags = maps[stdname]
- if flags then
- for _, flag in ipairs(table.wrap(flags)) do
- if self:has_flags(flag, "cxflags") then
- return flag
+ local result = maps[stdname]
+ if type(result) == "table" then
+ for _, v in ipairs(result) do
+ if self:has_flags(v, "cxflags") then
+ result = v
+ maps[stdname] = result
+ break
end
end
end
+ return result
end
-- make the define flag