Skip to content

[700] WASM 构建脚本#3677

Open
JimZhouZZY wants to merge 1 commit into
mainfrom
zzy/700
Open

[700] WASM 构建脚本#3677
JimZhouZZY wants to merge 1 commit into
mainfrom
zzy/700

Conversation

@JimZhouZZY

@JimZhouZZY JimZhouZZY commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Mogan for WASM is back, with PR 700~706

@JimZhouZZY

JimZhouZZY commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

还未来得及撰写文档一一说明 xmake.lua 的改动,先休息了

Comment thread 3rdparty/lolly/xmake.lua
set_toolchains("mingw@mingw-w64")
end

if is_plat("wasm") then

@JimZhouZZY JimZhouZZY Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lolly 的 xmake.lua 会覆盖原有的 toolchain,所以我删除了这块

Comment thread 3rdparty/tbox/xmake.lua
add_cxflags("gcc::-Wno-error=dangling-pointer")
end

-- set wasm toolchain

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto. 此处覆盖原有的 toolchain,所以我删除了这块

@@ -0,0 +1,89 @@
package("cpr")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cpr 原本的 xmake.lua 无法在 wasm 平台构建,因此拷贝了下来并添加 wasm 平台的支持

@JimZhouZZY JimZhouZZY force-pushed the zzy/700 branch 2 times, most recently from 7d47bde to 766d35a Compare June 10, 2026 10:37
if has_config("libjpeg") then
add_requires("libjpeg")
end
add_requires("freetype", "zlib", "libaesgm")

@JimZhouZZY JimZhouZZY Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

liii-libaesgm 需要作命名区分,因为在 pdfhummus 解析依赖的过程中仍然会去寻找 xrepo 的 libaesgm

@@ -0,0 +1,36 @@
package("qt6core")
set_base("qt6lib")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

相对于 xrepo 中的 xmake.lua:
添加了依赖 pcre2,否则链接器寻找不到
添加了链接参数"-lQt6BundledZLIB",否则链接器会去寻找系统(xmake)的 zlib,而系统的 zlib 不一定与 Qt 内置的相匹配

@@ -0,0 +1,54 @@
package("liii-pdfhummus")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

相比于 xrepo :添加了 WASM 平台的构建支持

@@ -0,0 +1,37 @@
package("qt6gui")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto. 相比于 xrepo 中的,添加了依赖项和链接参数

         elseif package:is_plat("wasm") then               
              package:add("deps", "harfbuzz", "libpng")
              package:data_set("links", "Qt6BundledZLIB")

@@ -0,0 +1,35 @@
package("qt6svg")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qt6svg 本来已经在 qt6core/qt6gui 里面了,这里写成包用于 include 头文件,(WASM 下不支持 add_framework)

@@ -0,0 +1,44 @@
package("qt6network")
set_base("qt6lib")

@JimZhouZZY JimZhouZZY Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qt6network 本来已经在 qt6core 里面了,这里写成包用于 include 头文件,(WASM 下不支持 add_framework)。与 xrepo 中的相比增加了链接参数 "Qt6BundledZLIB"

table.insert(aqt_args, "qtimageformats")
table.insert(aqt_args, "qtnetworkauth")
if not is_plat("wasm") then
-- Seems Qt's official WASM build does not support this package

@JimZhouZZY JimZhouZZY Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如 comment 所说,aqt拉下来的Qt 6.8.3官方 WASM 构建没有包括 qtnetworkauth

@@ -0,0 +1,105 @@
--!A cross-platform build utility based on Lua

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里在项目 toolchain 层面统一 emscripten 的一些编译选项

Comment thread xmake.lua
LOLLY_VERSION= "1.4.26"
S7_VERSION = "20240816"

package("liii-libaesgm")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

liii-libaesgm 挪到了 xmake/package 下面

Comment thread xmake.lua
package_end()

PDFHUMMUS_VERSION = "4.6.2"
package("liii-pdfhummus")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto, 挪到了 xmake/package 下面

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant