openpencil/crates/op-app/Cargo.toml
Kayshen-X 55d6972f50 fix(host): op-app opts into gl-host on desktop to keep native host API
Phase 0 follow-up. With op-host-native's gl-host now NON-default (approach Y),
op-app's plain dependency re-exported only the raster host, dropping
host_native::WidgetHostNative on desktop too (codex stop-review). Add a
desktop-only (macos/linux/windows) op-host-native edge with features=[gl-host]
so the documented native host API is present on desktop; the non-wasm base edge
(no gl-host) keeps iOS/Android raster. Verified: op-app builds; cargo tree shows
gl-host on desktop; a compile-check confirms op_app::host_native::WidgetHostNative
+ CursorHint resolve.
2026-06-19 18:06:48 +08:00

45 lines
2.1 KiB
TOML

[package]
name = "op-app"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
description = "OpenPencil composition root — re-exports the platform host entry points (op-host-native / op-host-web) and documents the editor app composition"
[lib]
name = "op_app"
path = "src/lib.rs"
# Phase 7.3 reorg: op-app is the thin composition root. The editor-UI
# composition itself (which widgets, the layout) already lives in the
# op-editor-ui crate, so there is no shared host bootstrap to host
# here today — op-app only re-exports the per-platform host entry
# points behind their target cfg. It deliberately stays thin (YAGNI):
# if real cross-host wiring later emerges, it lands here.
# The platform-agnostic editor-UI composition. Wasm-clean and already
# a transitive dep of both hosts, so this direct edge costs nothing.
[dependencies]
op-editor-ui = { path = "../op-editor-ui" }
# Native host — every non-wasm target incl. iOS / Android. Base edge WITHOUT
# `gl-host`, so the mobile cargo-check stays raster (no winit/glutin/skia-gl),
# matching op-host-native's own non-default gl-host (Phase 0 approach Y).
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
op-host-native = { path = "../op-host-native", version = "0.8.0" }
# Desktop adds the interactive GL host: `gl-host` brings winit + skia-safe `gl`
# + `WidgetHostNative`, so `host_native::WidgetHostNative` (the documented native
# host API) is available on macOS / Linux / Windows. Cargo unifies this with the
# base edge above into one op-host-native with gl-host on desktop; mobile keeps
# the raster base. (The shipped desktop binary is op-host-desktop, which depends
# on op-host-native with gl-host directly.)
[target.'cfg(any(target_os = "macos", target_os = "linux", target_os = "windows"))'.dependencies]
op-host-native = { path = "../op-host-native", version = "0.8.0", features = ["gl-host"] }
# Web host (wasm32-unknown-unknown bundle entry). Only resolved on
# the wasm32 target where op-host-web's cdylib / wasm-bindgen setup
# applies.
[target.'cfg(target_arch = "wasm32")'.dependencies]
op-host-web = { path = "../op-host-web", version = "0.8.0" }