summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/rules/qt/load.lua3
-rw-r--r--xmake/rules/qt/xmake.lua6
2 files changed, 8 insertions, 1 deletions
diff --git a/xmake/rules/qt/load.lua b/xmake/rules/qt/load.lua
index dcb8343ef..ffe4f26d6 100644
--- a/xmake/rules/qt/load.lua
+++ b/xmake/rules/qt/load.lua
@@ -368,6 +368,9 @@ function main(target, opt)
_add_includedirs(target, path.join(qt.mkspecsdir, "wasm-emscripten"))
target:add("rpathdirs", qt.libdir)
target:add("linkdirs", qt.libdir)
+ for _, filepath in ipairs(os.files(path.join(qt.libdir, "objects-*","**.o"))) do
+ table.insert(target:objectfiles(), filepath)
+ end
target:add("ldflags", "-s WASM=1", "-s FETCH=1", "-s FULL_ES2=1", "-s FULL_ES3=1", "-s USE_WEBGL2=1", "--bind")
target:add("ldflags", "-s ERROR_ON_UNDEFINED_SYMBOLS=1", "-s EXTRA_EXPORTED_RUNTIME_METHODS=[\"UTF16ToString\",\"stringToUTF16\"]", "-s ALLOW_MEMORY_GROWTH=1")
target:add("shflags", "-s WASM=1", "-s FETCH=1", "-s FULL_ES2=1", "-s FULL_ES3=1", "-s USE_WEBGL2=1", "--bind")
diff --git a/xmake/rules/qt/xmake.lua b/xmake/rules/qt/xmake.lua
index 9737d828b..3815b8a11 100644
--- a/xmake/rules/qt/xmake.lua
+++ b/xmake/rules/qt/xmake.lua
@@ -221,9 +221,11 @@ rule("qt.quickapp_static")
-- https://github.com/xmake-io/xmake/issues/1047
-- https://github.com/xmake-io/xmake/issues/2791
local QtPlatformSupport
+ local OldQtWasm = true;
if qt_sdkver then
if qt_sdkver:ge("6.0") then
QtPlatformSupport = nil
+ OldQtWasm = false;
elseif qt_sdkver:ge("5.9") then
QtPlatformSupport = "QtPlatformCompositorSupport"
else
@@ -248,7 +250,9 @@ rule("qt.quickapp_static")
end
elseif target:is_plat("wasm") then
plugins.QWasmIntegrationPlugin = {linkdirs = "plugins/platforms", links = {"qwasm"}}
- table.join2(frameworks, "QtEventDispatcherSupport", "QtFontDatabaseSupport", "QtEglSupport")
+ if OldQtWasm then
+ table.join2(frameworks, "QtEventDispatcherSupport", "QtFontDatabaseSupport", "QtEglSupport")
+ end
end
import("load")(target, {gui = true, plugins = plugins, frameworks = frameworks})
end)