[700] WASM 构建脚本#3677
Conversation
|
还未来得及撰写文档一一说明 xmake.lua 的改动,先休息了 |
| set_toolchains("mingw@mingw-w64") | ||
| end | ||
|
|
||
| if is_plat("wasm") then |
There was a problem hiding this comment.
Lolly 的 xmake.lua 会覆盖原有的 toolchain,所以我删除了这块
| add_cxflags("gcc::-Wno-error=dangling-pointer") | ||
| end | ||
|
|
||
| -- set wasm toolchain |
There was a problem hiding this comment.
ditto. 此处覆盖原有的 toolchain,所以我删除了这块
| @@ -0,0 +1,89 @@ | |||
| package("cpr") | |||
There was a problem hiding this comment.
cpr 原本的 xmake.lua 无法在 wasm 平台构建,因此拷贝了下来并添加 wasm 平台的支持
7d47bde to
766d35a
Compare
| if has_config("libjpeg") then | ||
| add_requires("libjpeg") | ||
| end | ||
| add_requires("freetype", "zlib", "libaesgm") |
There was a problem hiding this comment.
liii-libaesgm 需要作命名区分,因为在 pdfhummus 解析依赖的过程中仍然会去寻找 xrepo 的 libaesgm
| @@ -0,0 +1,36 @@ | |||
| package("qt6core") | |||
| set_base("qt6lib") | |||
There was a problem hiding this comment.
相对于 xrepo 中的 xmake.lua:
添加了依赖 pcre2,否则链接器寻找不到
添加了链接参数"-lQt6BundledZLIB",否则链接器会去寻找系统(xmake)的 zlib,而系统的 zlib 不一定与 Qt 内置的相匹配
| @@ -0,0 +1,54 @@ | |||
| package("liii-pdfhummus") | |||
There was a problem hiding this comment.
相比于 xrepo :添加了 WASM 平台的构建支持
| @@ -0,0 +1,37 @@ | |||
| package("qt6gui") | |||
There was a problem hiding this comment.
ditto. 相比于 xrepo 中的,添加了依赖项和链接参数
elseif package:is_plat("wasm") then
package:add("deps", "harfbuzz", "libpng")
package:data_set("links", "Qt6BundledZLIB")
| @@ -0,0 +1,35 @@ | |||
| package("qt6svg") | |||
There was a problem hiding this comment.
qt6svg 本来已经在 qt6core/qt6gui 里面了,这里写成包用于 include 头文件,(WASM 下不支持 add_framework)
| @@ -0,0 +1,44 @@ | |||
| package("qt6network") | |||
| set_base("qt6lib") | |||
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
如 comment 所说,aqt拉下来的Qt 6.8.3官方 WASM 构建没有包括 qtnetworkauth
| @@ -0,0 +1,105 @@ | |||
| --!A cross-platform build utility based on Lua | |||
There was a problem hiding this comment.
这里在项目 toolchain 层面统一 emscripten 的一些编译选项
| LOLLY_VERSION= "1.4.26" | ||
| S7_VERSION = "20240816" | ||
|
|
||
| package("liii-libaesgm") |
There was a problem hiding this comment.
liii-libaesgm 挪到了 xmake/package 下面
| package_end() | ||
|
|
||
| PDFHUMMUS_VERSION = "4.6.2" | ||
| package("liii-pdfhummus") |
There was a problem hiding this comment.
ditto, 挪到了 xmake/package 下面
Mogan for WASM is back, with PR 700~706