feat(universal): route core universal modules through the cdylib mechanism (#12)

apiStyle for `interface: "universal"` core modules becomes "lp" (was "std"):
they now build as header-first cdylibs — Qt-free impl + the common
module-impl C ABI export seam + uniform Qt glue, with outbound
modules().<dep> calls hitting logos-protocol's lp_* C ABI directly. An
unchanged universal module recompiles Qt-free in its impl/wrapper TUs and
still loads via the same Qt plugin (load + call ABI preserved).

UI universal backends (type: ui_qml) derive a Qt SimpleSource and cannot be
Qt-free, so they stay on the std surface. Everything else (legacy) stays qt.

Pairs with logos-module-builder modulePreConfigure.universalCodegen, which
now derives the LIDL from the impl header and runs the cdylib backend.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Dario Lipicar
2026-06-14 00:55:13 -03:00
committed by GitHub
co-authored by Claude Opus 4.8
parent 82fe9fa76f
commit 3aefbc55b5
+8 -5
View File
@@ -25,12 +25,15 @@
# dep already ships pre-built header variants (`.headers-qt` and
# `.headers-std` — see mkLogosModule.nix's `buildHeaders` calls),
# so we just copy from the right one. No codegen at consume time.
# cdylib modules get the Qt-free outbound surface: the generated
# LogosModules umbrella + dep wrappers call the logos-protocol C ABI
# (lp_*) directly, so the module's own TUs never include Qt. universal
# modules keep the std surface (Qt bridged inside the generated .cpp);
# everything else stays Qt-typed.
# cdylib AND core universal modules get the Qt-free outbound surface: the
# generated LogosModules umbrella + dep wrappers call the logos-protocol C
# ABI (lp_*) directly, so the module's own TUs never include Qt (universal
# is now a header-first cdylib — see modulePreConfigure.universalCodegen).
# UI universal backends (type: ui_qml) inherently derive a Qt SimpleSource,
# so they stay on the std surface (Qt bridged inside the generated .cpp);
# everything else (legacy / handcrafted Qt) stays Qt-typed.
apiStyle = if config.interface == "cdylib" then "lp"
else if config.interface == "universal" && (config.type or "core") != "ui_qml" then "lp"
else if config.interface == "universal" then "std"
else "qt";