summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-02-28 22:52:28 +0800
committerruki <[email protected]>2023-02-28 22:52:28 +0800
commit9e550246e91d3b641141206db9f1638fd65af218 (patch)
tree951c26ee90cfcf3235a2702dc66af8f3a7c41940
parent6627f5cfb7db944367c5668be2267402dc1ed7f5 (diff)
fix mingw include for qt
-rw-r--r--xmake/rules/qt/load.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/xmake/rules/qt/load.lua b/xmake/rules/qt/load.lua
index 7ed4f5049..45c4e516c 100644
--- a/xmake/rules/qt/load.lua
+++ b/xmake/rules/qt/load.lua
@@ -331,7 +331,13 @@ function main(target, opt)
-- we need fix it, because gcc maybe does not work on latest mingw when `-isystem D:\a\_temp\msys64\mingw64\include` is passed.
-- and qt.includedir will be this path value when Qt sdk directory just is `D:\a\_temp\msys64\mingw64`
-- @see https://github.com/msys2/MINGW-packages/issues/10761#issuecomment-1044302523
- if qt.includedir and os.isdir(qt.includedir) then
+ if is_subhost("msys") then
+ local mingw_prefix = os.getenv("MINGW_PREFIX")
+ local mingw_includedir = path.normalize(path.join(mingw_prefix or "/", "include"))
+ if qt.includedir and qt.includedir and path.normalize(qt.includedir) ~= mingw_includedir then
+ _add_includedirs(target, qt.includedir)
+ end
+ else
_add_includedirs(target, qt.includedir)
end
_add_includedirs(target, path.join(qt.mkspecsdir, "win32-g++"))