summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/sdcc.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/sdcc.lua
parent130d0f14a97915934eb2e82fda05b25ca7f7284f (diff)
improve languages
Diffstat (limited to 'xmake/modules/core/tools/sdcc.lua')
-rw-r--r--xmake/modules/core/tools/sdcc.lua18
1 files changed, 14 insertions, 4 deletions
diff --git a/xmake/modules/core/tools/sdcc.lua b/xmake/modules/core/tools/sdcc.lua
index d2aece2e1..526254fe7 100644
--- a/xmake/modules/core/tools/sdcc.lua
+++ b/xmake/modules/core/tools/sdcc.lua
@@ -106,7 +106,6 @@ function nf_language(self, stdname)
if _g.cmaps == nil then
_g.cmaps =
{
- -- stdc
ansi = "--std-c89"
, c89 = "--std-c89"
, gnu89 = "--std-sdcc89"
@@ -116,11 +115,22 @@ function nf_language(self, stdname)
, gnu11 = "--std-sdcc11"
, c20 = "--std-c2x"
, gnu20 = "--std-sdcc2x"
- , clatest = "--std-c2x"
- , gnulatest = "--std-sdcc2x"
+ , clatest = {"--std-c2x", "--std-c11", "--std-c99", "--std-c89"}
+ , gnulatest = {"--std-sdcc2x", "--std-sdcc11", "--std-sdcc99", "--std-sdcc89"}
}
end
- return _g.cmaps[stdname]
+ local maps = _g.cmaps
+ 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