diff options
| -rw-r--r-- | xmake/rules/qt/config_static.lua | 30 |
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; |
