summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2021-02-05 22:36:46 +0800
committerruki <[email protected]>2021-02-06 16:10:15 +0800
commitd22cf65fb3cce961dbfbdefee29f9dfeed08f64e (patch)
tree5e36b946a0e2101163a195528fb8be695d9601a7
parentebef554d2785e983bd8e7405f08d93f9a289ecc9 (diff)
improve c++ languages for qt6
-rw-r--r--CHANGELOG.md2
-rw-r--r--xmake/rules/qt/load.lua8
2 files changed, 9 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6bf62432b..5b3743a7e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -13,6 +13,7 @@
### Change
* [#1226](https://github.com/xmake-io/xmake/issues/1226): Add missing qt include directories
+* [#1183](https://github.com/xmake-io/xmake/issues/1183): Improve c++ lanuages to support Qt6
### Bugs fixed
@@ -929,6 +930,7 @@
### 改进
* [#1226](https://github.com/xmake-io/xmake/issues/1226): 添加缺失的 Qt 头文件搜索路径
+* [#1183](https://github.com/xmake-io/xmake/issues/1183): 改进 C++ 语言标准,以便支持 Qt6
### Bugs 修复
diff --git a/xmake/rules/qt/load.lua b/xmake/rules/qt/load.lua
index 4668bda7b..508810709 100644
--- a/xmake/rules/qt/load.lua
+++ b/xmake/rules/qt/load.lua
@@ -127,7 +127,13 @@ function main(target, opt)
end
end
if not cxxlang then
- target:add("languages", "cxx11")
+ -- Qt6 require at least '/std:c++17'
+ -- @see https://github.com/xmake-io/xmake/issues/1183
+ if qt_sdkver:ge("6.0") then
+ target:add("languages", "c++17")
+ else
+ target:add("languages", "c++11")
+ end
end
-- add defines for the compile mode