summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2024-05-04 09:46:38 +0800
committerGitHub <[email protected]>2024-05-04 09:46:38 +0800
commit57a6b50a9ff4b87360b0147fab067ee806ebf587 (patch)
treeadcc3ef837218352c7b2aafef6be9f8275393f29
parentf0009e024865905b16a17968addab1d32a7962b9 (diff)
parent25a84c6d90c7851342f3a5ec60497f1a3304861d (diff)
Merge pull request #5050 from Arthapz/improve-c23-and-add-c++26
improve c23 and add c++26 flags support
-rw-r--r--xmake/modules/core/tools/gcc.lua14
1 files changed, 10 insertions, 4 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index e3fa97a27..ffd3ff895 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -235,8 +235,10 @@ function nf_language(self, stdname)
, gnu11 = "-std=gnu11"
, c17 = "-std=c17"
, gnu17 = "-std=gnu17"
- , clatest = {"-std=c2x", "-std=c17", "-std=c11", "-std=c99", "-std=c89", "-ansi"}
- , gnulatest = {"-std=c2x", "-std=gnu17", "-std=gnu11", "-std=gnu99", "-std=gnu89", "-ansi"}
+ , c23 = {"-std=c23", "-std=c2x"}
+ , gnu23 = {"-std=gnu23", "-std=gnu2x"}
+ , clatest = {"-std=c23", "-std=c2x", "-std=c17", "-std=c11", "-std=c99", "-std=c89", "-ansi"}
+ , gnulatest = {"-std=gnu23", "-std=gnu2x", "-std=gnu17", "-std=gnu11", "-std=gnu99", "-std=gnu89", "-ansi"}
}
end
@@ -263,8 +265,12 @@ function nf_language(self, stdname)
, gnuxx23 = {"-std=gnu++23", "-std=c++2b"}
, cxx2b = "-std=c++2b"
, gnuxx2b = "-std=gnu++2b"
- , cxxlatest = {"-std=c++23", "-std=c++2b", "-std=c++20", "-std=c++2a", "-std=c++17", "-std=c++14", "-std=c++11", "-std=c++1z", "-std=c++98"}
- , gnuxxlatest = {"-std=gnu++23", "-std=gnu++2b", "-std=gnu++20", "-std=gnu++2a", "-std=gnu++17", "-std=gnu++14", "-std=gnu++11", "-std=c++1z", "-std=gnu++98"}
+ , cxx2c = "-std=c++2c"
+ , gnuxx2c = "-std=gnu++2c"
+ , cxx26 = {"-std=c++26", "-std=c++2c"}
+ , gnuxx26 = {"-std=gnu++26", "-std=gnu++2c"}
+ , cxxlatest = {"-std=c++26", "-std=c++2c", "-std=c++23", "-std=c++2b", "-std=c++20", "-std=c++2a", "-std=c++17", "-std=c++14", "-std=c++11", "-std=c++1z", "-std=c++98"}
+ , gnuxxlatest = {"-std=gnu++26", "-std=gnu++2c", "-std=gnu++23", "-std=gnu++2", "-std=gnu++20", "-std=gnu++2a", "-std=gnu++17", "-std=gnu++14", "-std=gnu++11", "-std=c++1z", "-std=gnu++98"}
}
local cxxmaps2 = {}
for k, v in pairs(_g.cxxmaps) do