Repository navigation
build: HuxerUI and its applications on six platforms with mcpp, beside CMake - #7
Open
Sunrisepeak wants to merge 1 commit into
Open
Sunrisepeak wants to merge 1 commit into
Sunrisepeak wants to merge 1 commit into
Conversation
Sunrisepeak
force-pushed
the
mcpp-six-platforms
branch
from
September 13, 2026 09:39
be26617 to
f819254
Compare
This was referenced Sep 13, 2026
Open
Sunrisepeak
force-pushed
the
mcpp-six-platforms
branch
from
September 13, 2026 11:12
f819254 to
429a18d
Compare
Sunrisepeak
force-pushed
the
mcpp-six-platforms
branch
4 times, most recently
from
September 13, 2026 18:41
534b73b to
5356991
Compare
Sunrisepeak
force-pushed
the
mcpp-six-platforms
branch
4 times, most recently
from
September 15, 2026 08:41
6bdea48 to
f21cbc7
Compare
… beside CMake One manifest builds the framework and every application for Linux, Windows, macOS, iOS, Android and the Web. Through the huxerui CLI the two build systems produce the same program, and CMake's own files are untouched. - docs/design/build-systems-spec.md states what the two must agree on: the default program model, the extension points a developer has under both, the differences allowed with their reasons, and the SDK and CLI rules. build-systems-conformance.yml creates one application for each build system, packages both with `huxerui package`, and fails on a program model fact the specification does not allow to differ. - The program model is CMake's: the framework is its own libhuxerui.so on the Android row and static elsewhere; one resource package per application merges the framework's, each direct HuxerUI library's (`package_product`) and the application's (`app`); the Android manifest, BuildConfig, Info.plist entries, icons and Web page are the CLI templates'; a release APK is unsigned and its native libraries are stripped and stored; floors API 23, iOS 15.0, macOS 12.0; profiling is a feature, off by default. - Extension points: an application's android/java, android/kotlin, android/res, android/libs and Maven lock (the framework's android-kotlin and android-maven features), ios/Info.plist and macos/Info.plist, signing options, iOS devices; a library's resources and Android sources. - The artifacts are `huxerui package`'s, published to dist/<platform>: AppImage, the Setup.exe with the application's installer interface (built for a package only, through the windows-installer feature), DMG, a two-ABI APK, the .app, the Web directory; mcpp 2026.9.15.2 and mcpp:plugins 0.11.1. - Everything is c++20; the macOS and iOS rows' libc++ (`llvm.libcxx` 22.1.8.3) states its own standard. - CMake's four test suites are one package each under mcpp/huxerui-tests. - CLI: one interface for both build systems. In an mcpp project build, run, package and platform add run mcpp; package publishes the artifacts mcpp reports; the profile is named to mcpp; run ios --device reaches devicectl-run; doctor stays read-only and points at `mcpp self doctor`; the separate `huxerui mcpp build` frontend is gone. - Docs: the specification, the design record, and docs/guide/cpp-modules-and-mcpp.md, which says where platform code and metadata go and what mcpp adds beyond the CMake build. - CI: one job per row inspecting each artifact, the generated templates, parity, and the conformance check. - The Windows installer template names `ButtonStyle::corner_radii`, the field 09ec2ab renamed. CMake: framework files untouched; shared with CMake are the installer template fix, hrc's optional depfile/module flags, the spelled-out `NodeExtensionHandle::operator==`, and the CLI's source list (mcpp_backend.cpp in, the mcpp/mcpp.cpp frontend out).
Sunrisepeak
force-pushed
the
mcpp-six-platforms
branch
from
September 15, 2026 20:10
f21cbc7 to
ed896c9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
中文
HuxerUI 增加第二个构建系统:mcpp 用一个
mcpp.toml构建框架和应用,覆盖 Linux / Windows / macOS / iOS / Android / Web。CMake 构建不变,两者并存。本 PR 是 A;Lib-Live2D 的 B(Sunrisepeak/Lib-Live2D#2)和 live2d 模板 C(#8)依赖它。1. 两个构建系统必须一致的内容:规范与验证
docs/design/build-systems-spec.md规定默认程序模型(链接、资源包与命名空间、资源位置、平台下限、应用 id 与图标、Android manifest 与 native 库、Info.plist、签名、产物与发布位置)、开发者扩展点、允许的差异,以及 SDK / CLI 的规则。build-systems-conformance.yml用同一个 CLI 分别创建 CMake 与 mcpp 应用,huxerui package <平台>打包,读出产物的程序模型事实并比对。差异不在规范白名单里就失败。PR 上跑 Linux / Web / Android,每周和手动触发跑六个平台。白名单里的差异,每条都附理由:
[package] version;2. mcpp 构建:默认与 CMake 相同
libhuxerui.so,Java 侧加载方式不变package_product)→ 应用(app)BuildConfig与MainActivity与 Gradle 模板相同.app、Web 目录,发布到dist/<平台>android/java、android/kotlin、android/res、android/libs、Maven 锁文件,ios/Info.plist、macos/Info.plist,iOS 真机;库的资源与 Android 源码依赖的外部版本: mcpp 2026.9.15.2、
mcpp:plugins0.11.1(mcpp-community/mcpp-plugins#27:dist-apk 剥离 native 库并按 manifest 不压缩存放,dist-appimage 支持 SVG 图标)。3. SDK / CLI 改动与理由
SDK(与 CMake 共用;框架运行时和平台代码没有改动)
NodeExtensionHandle::operator==改为手写,语义与= default相同。原因:clang 搭配 MSVC 标准库时默认版本让std::find编译失败(<xutility>: std::find no longer compiles with structs with defaulted equality comparison with Clang-CL microsoft/STL#6294)。--depfile、--module-name,CMake 不传,行为不变。corner_radius改为corner_radii:upstream 缺陷,CMake 生成的安装界面同样编译不过。mcpp.toml许可证改为 MIT,只是包元数据。CLI(CMake 项目的行为不变)
build、run、package、platform add调用 mcpp。package把 mcpp 报告的产物发布到dist/<平台>,与 CMake 项目相同;Windows 打包传--features windows-installer,安装界面只在打包时构建,与 CMake 相同。--profile显式传给 mcpp(dev/release)。原因:mcpp pack没有--release,且默认是 release。run ios --device映射到aarch64-ios,设备经DEVICECTL_RUN_DEVICE交给devicectl-run(未在真机上实测)。doctor保持只读;删除重复的huxerui mcpp build;create --build mcpp支持--platform、--id。platforms键逐行匹配,不用std::regex::multiline:MSVC 标准库没有它,CLI 在 Windows 上编译不过。mcpp_backend.cpp,删除mcpp/mcpp.cpp。4. mcpp 构建相对 CMake 的额外能力
可选,直接用 mcpp 命令或清单,不经过 CLI:全模块(
import huxerui;、资源模块)、自动准备的环境、一个清单六个平台、MSI / AAB / macOS.app、在模拟器和设备上直接运行、mcpp test、按次切换工具链、锁文件、桌面共享框架。见docs/guide/cpp-modules-and-mcpp.md。5. 验证与未覆盖的部分
English
HuxerUI gains a second build system: mcpp builds the framework and applications from one
mcpp.tomlfor Linux, Windows, macOS, iOS, Android and the Web. The CMake build is unchanged, and the two coexist. This PR is A; Lib-Live2D's B (Sunrisepeak/Lib-Live2D#2) and the live2d template C (#8) build on it.1. What the two build systems must agree on: a specification and a check
docs/design/build-systems-spec.mddefines three things and the rules the SDK and the CLI follow:build-systems-conformance.ymlcreates the same application for CMake and for mcpp with one CLI and packages each withhuxerui package <platform>. It then reads the program model facts from both artifacts and fails on any difference the specification does not list. Linux, the Web and Android run on pull requests; all six platforms run weekly and on request.Each allowed difference carries its reason:
[package] version.2. The mcpp build: CMake's program by default
libhuxerui.soon Android, loaded by the Java host as beforepackage_product) → the application (app)BuildConfigandMainActivityas the Gradle template has them.app, Web directory, published todist/<platform>android/java,android/kotlin,android/res,android/libsand Maven lock,ios/Info.plistandmacos/Info.plist, iOS devices; a library's resources and Android sourcesExternal versions: mcpp 2026.9.15.2 and
mcpp:plugins0.11.1 (mcpp-community/mcpp-plugins#27):3. SDK / CLI changes and why
SDK (shared with CMake; no framework runtime or platform code changes)
NodeExtensionHandle::operator==is written out, equivalent to= default: with clang and the MSVC standard library the defaulted version breaksstd::find(<xutility>: std::find no longer compiles with structs with defaulted equality comparison with Clang-CL microsoft/STL#6294).--depfileand--module-name; CMake passes neither.corner_radiiinstead ofcorner_radius. This is an upstream defect: the interface CMake generates did not compile either.mcpp.tomllicence is MIT; package metadata only.CLI (CMake projects unchanged)
build,run,packageandplatform addrun mcpp.packagepublishes the artifacts mcpp reports todist/<platform>, as for a CMake project.--features windows-installer, so the installer interface is built for a package only, as under CMake.--profileis passed to mcpp explicitly (dev/release), becausemcpp packhas no--releaseand defaults to release.run ios --devicemaps toaarch64-ios; the device reachesdevicectl-runasDEVICECTL_RUN_DEVICE. This is not measured on a device.doctorstays read-only.huxerui mcpp buildis removed.create --build mcpptakes--platformand--id.platformskey is matched line by line rather than withstd::regex::multiline, which MSVC's standard library lacks; the CLI did not compile on Windows.mcpp_backend.cppis added andmcpp/mcpp.cppremoved.4. What the mcpp build adds beyond CMake
These are optional, and used through mcpp or the manifest rather than the CLI:
import huxerui;, a resource module);.app;mcpp test, per-command toolchains and a lock file;See
docs/guide/cpp-modules-and-mcpp.md.5. Verification and what is not covered