summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstar-hengxing <[email protected]>2023-05-01 17:22:12 +0800
committerstar-hengxing <[email protected]>2023-05-01 17:22:12 +0800
commite94f9404d8ab97ff09ad8d92c1ade0fce7375bd9 (patch)
tree7682cab73b02f15066aa5d5838fe427e028b3168
parentf734c448b4d424bc2409c74246bd4e2ffa3fb790 (diff)
fix qt compile
-rw-r--r--xmake/modules/detect/tools/find_mold.lua1
-rw-r--r--xmake/rules/qt/load.lua12
2 files changed, 8 insertions, 5 deletions
diff --git a/xmake/modules/detect/tools/find_mold.lua b/xmake/modules/detect/tools/find_mold.lua
index bcba774c3..5c6f32ffb 100644
--- a/xmake/modules/detect/tools/find_mold.lua
+++ b/xmake/modules/detect/tools/find_mold.lua
@@ -21,6 +21,7 @@
-- imports
import("core.tool.compiler")
import("lib.detect.find_program")
+import("lib.detect.find_programver")
-- find ar
--
diff --git a/xmake/rules/qt/load.lua b/xmake/rules/qt/load.lua
index 6544d2409..1ae5c67c6 100644
--- a/xmake/rules/qt/load.lua
+++ b/xmake/rules/qt/load.lua
@@ -143,6 +143,13 @@ function main(target, opt)
target:add("asflags", "-fPIC")
end
+ if qt_sdkver:ge("6.0") then
+ -- @see https://github.com/xmake-io/xmake/issues/2071
+ if target:is_plat("windows") then
+ target:add("cxxflags", "/Zc:__cplusplus")
+ target:add("cxxflags", "/permissive-")
+ end
+ end
-- need c++11 at least
local languages = target:get("languages")
local cxxlang = false
@@ -162,11 +169,6 @@ function main(target, opt)
if (not cppversion) or (tonumber(cppversion) and tonumber(cppversion) < 17) then
target:add("languages", "c++17")
end
- -- @see https://github.com/xmake-io/xmake/issues/2071
- if target:is_plat("windows") then
- target:add("cxxflags", "/Zc:__cplusplus")
- target:add("cxxflags", "/permissive-")
- end
else
-- add conditionnaly c++11 to avoid for example "cl : Command line warning D9025 : overriding '/std:c++latest' with '/std:c++11'" warning
if (not cppversion) or (tonumber(cppversion) and tonumber(cppversion) < 11) then