summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcarols <[email protected]>2022-09-29 20:30:07 +0800
committer[email protected] <[email protected]>2022-09-29 21:02:31 +0800
commit34dd0f03af660bef5c62efc4c77c16da66c1a579 (patch)
treec3ca061d4658fb834c47e2eae9be2381e13800cb
parentd4b5d624463329172d9c6a7d358b561130b8254b (diff)
fix link error on linux when use qt4
-rw-r--r--xmake/rules/qt/load.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/rules/qt/load.lua b/xmake/rules/qt/load.lua
index ee4a3f601..4e76fe348 100644
--- a/xmake/rules/qt/load.lua
+++ b/xmake/rules/qt/load.lua
@@ -39,7 +39,11 @@ function _link(target, linkdirs, framework, qt_sdkver)
if qt_sdkver:ge("5.0") then
framework = "Qt" .. qt_sdkver:major() .. framework:sub(3) .. (is_mode("debug") and debug_suffix or "")
else -- for qt4.x, e.g. QtGui4.lib
- framework = "Qt" .. framework:sub(3) .. (is_mode("debug") and debug_suffix or "") .. qt_sdkver:major()
+ if target:is_plat("windows") or target:is_plat("mingw") then
+ framework = "Qt" .. framework:sub(3) .. (is_mode("debug") and debug_suffix or "") .. qt_sdkver:major()
+ else
+ framework = "Qt" .. framework:sub(3) .. (is_mode("debug") and debug_suffix or "")
+ end
end
if target:is_plat("android") then --> -lQt5Core_armeabi/-lQt5CoreDebug_armeabi for 5.14.x
local libinfo = find_library(framework .. "_" .. config.arch(), linkdirs)