summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-09-26 22:50:17 +0800
committerruki <[email protected]>2021-09-26 22:50:17 +0800
commit57222b35a8c1ba36d5487345e4fb16b40d07fd0e (patch)
tree31a0a2b195e973914912919f5dc9c5da3e1621a0
parent38ad0e37b05036a5bce2731e921b86eac846cb1b (diff)
add c++latest
-rw-r--r--CHANGELOG.md2
-rw-r--r--xmake/modules/core/tools/cl.lua16
-rw-r--r--xmake/modules/core/tools/gcc.lua8
3 files changed, 18 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index afe228046..f93fde1a4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,6 +18,7 @@
* [#1675](https://github.com/xmake-io/xmake/pull/1675): Rename dynamic and import library suffix for mingw
* [#1694](https://github.com/xmake-io/xmake/issues/1694): Support to define a variable without quotes for configuration files
* Support Android NDK r23
+* Add `c++latest` and `clatest` for `set_languages`
### Bugs fixed
@@ -1098,6 +1099,7 @@
* [#1675](https://github.com/xmake-io/xmake/pull/1675): 针对 mingw 平台,重命名动态库和导入库文件名后缀
* [#1694](https://github.com/xmake-io/xmake/issues/1694): 支持在 set_configvar 中定义一个不带引号的字符串变量
* 改进对 Android NDK r23 的支持
+* 为 `set_languages` 新增 `c++latest` 和 `clatest` 配置值
### Bugs 修复
diff --git a/xmake/modules/core/tools/cl.lua b/xmake/modules/core/tools/cl.lua
index d95d58e5d..0cad0abd6 100644
--- a/xmake/modules/core/tools/cl.lua
+++ b/xmake/modules/core/tools/cl.lua
@@ -197,12 +197,14 @@ function nf_language(self, stdname)
_g.cmaps =
{
-- stdc
- c99 = "-TP" -- compile as c++ files because older msvc only support c89
- , gnu99 = "-TP"
- , c11 = {"-std:c11", "-TP"}
- , gnu11 = {"-std:c11", "-TP"}
- , c17 = {"-std:c17", "-TP"}
- , gnu17 = {"-std:c17", "-TP"}
+ c99 = "-TP" -- compile as c++ files because older msvc only support c89
+ , gnu99 = "-TP"
+ , c11 = {"-std:c11", "-TP"}
+ , gnu11 = {"-std:c11", "-TP"}
+ , c17 = {"-std:c17", "-TP"}
+ , gnu17 = {"-std:c17", "-TP"}
+ , clatest = "-std:c17"
+ , gnulatest = "-std:c17"
}
end
@@ -222,6 +224,8 @@ function nf_language(self, stdname)
, gnuxx20 = {"-std:c++20", "-std:c++latest"}
, cxx2a = {"-std:c++20", "-std:c++latest"}
, gnuxx2a = {"-std:c++20", "-std:c++latest"}
+ , cxxlatest = "-std:c++latest"
+ , gnuxxlatest = "-std:c++latest"
}
local cxxmaps2 = {}
for k, v in pairs(_g.cxxmaps) do
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 952f89dff..bb0bef168 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -180,6 +180,8 @@ function nf_language(self, stdname)
, gnu11 = "-std=gnu11"
, c17 = "-std=c17"
, gnu17 = "-std=gnu17"
+ , clatest = "-std=c17"
+ , gnulatest = "-std=gnu17"
}
end
@@ -197,10 +199,12 @@ function nf_language(self, stdname)
, gnuxx17 = "-std=gnu++17"
, cxx1z = "-std=c++1z"
, gnuxx1z = "-std=gnu++1z"
- , cxx20 = "-std=c++2a"
- , gnuxx20 = "-std=gnu++2a"
+ , cxx20 = "-std=c++20"
+ , gnuxx20 = "-std=gnu++20"
, cxx2a = "-std=c++2a"
, gnuxx2a = "-std=gnu++2a"
+ , cxxlatest = "-std=c++2a"
+ , gnuxxlatest = "-std=gnu++2a"
}
local cxxmaps2 = {}
for k, v in pairs(_g.cxxmaps) do