summaryrefslogtreecommitdiff
path: root/xmake/rules
diff options
context:
space:
mode:
authorjingkaimori <[email protected]>2023-04-03 00:24:39 +0800
committerjingkaimori <[email protected]>2023-04-03 00:24:39 +0800
commit11bb7953211c61455fac2d4bbdb16c7a1dd17a9d (patch)
treec79664e556561c19ce7d5cb62f8429c4b621a5a4 /xmake/rules
parente0f0066e8bfe0aee40f152a51fcb917f1b5ee924 (diff)
improve detection of qt version at config stage
Diffstat (limited to 'xmake/rules')
-rw-r--r--xmake/rules/qt/config_static.lua30
1 files changed, 15 insertions, 15 deletions
diff --git a/xmake/rules/qt/config_static.lua b/xmake/rules/qt/config_static.lua
index 441fa519b..e8fbed3dd 100644
--- a/xmake/rules/qt/config_static.lua
+++ b/xmake/rules/qt/config_static.lua
@@ -18,27 +18,29 @@
-- @file config_static.lua
--
+-- imports
+import("core.base.semver")
+
function main(target)
-- get qt sdk version
local qt = target:data("qt")
local qt_sdkver = nil
if qt.sdkver then
- import("core.base.semver")
qt_sdkver = semver.new(qt.sdkver)
+ else
+ raise("Qt SDK version not found, please run `xmake f --qt_sdkver=xxx` to set it.")
end
-- @see
-- https://github.com/xmake-io/xmake/issues/1047
-- https://github.com/xmake-io/xmake/issues/2791
local QtPlatformSupport
- if qt_sdkver then
- if qt_sdkver:ge("6.0") then
- QtPlatformSupport = nil
- elseif qt_sdkver:ge("5.9") then
- QtPlatformSupport = "QtPlatformCompositorSupport"
- else
- QtPlatformSupport = "QtPlatformSupport"
- end
+ if qt_sdkver:ge("6.0") then
+ QtPlatformSupport = nil
+ elseif qt_sdkver:ge("5.9") then
+ QtPlatformSupport = "QtPlatformCompositorSupport"
+ else
+ QtPlatformSupport = "QtPlatformSupport"
end
-- load some basic plugins and frameworks
@@ -58,12 +60,10 @@ function main(target)
end
elseif target:is_plat("wasm") then
plugins.QWasmIntegrationPlugin = {linkdirs = "plugins/platforms", links = {"qwasm"}}
- if qt_sdkver then
- if qt_sdkver:ge("6.0") then
- table.join2(frameworks, "QtOpenGL")
- else
- table.join2(frameworks, "QtEventDispatcherSupport", "QtFontDatabaseSupport", "QtEglSupport")
- end
+ if qt_sdkver:ge("6.0") then
+ table.join2(frameworks, "QtOpenGL")
+ else
+ table.join2(frameworks, "QtEventDispatcherSupport", "QtFontDatabaseSupport", "QtEglSupport")
end
end
return frameworks, plugins, qt_sdkver;