cranpose 0.9.21

Build desktop, mobile and web apps with composable Rust functions
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
[package]
name = "cranpose"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
authors.workspace = true
keywords.workspace = true
categories.workspace = true
readme = "README.md"
description = "Build desktop, mobile and web apps with composable Rust functions"
autotests = false

[package.metadata.docs.rs]
# docs.rs builds on Linux, where the android/ios/web features cannot compile.
# Name the desktop set so the published page shows the API a reader can use.
features = ["desktop", "renderer-wgpu"]
rustdoc-args = ["--cfg", "docsrs"]

[lints]
workspace = true

[package.metadata.cargo-machete]
ignored = ["cranpose-render-pixels"]

[features]
localized-arabic = ["dep:cranpose-fonts", "cranpose-fonts/arabic"]
localized-devanagari = ["dep:cranpose-fonts", "cranpose-fonts/devanagari"]
localized-cjk = ["dep:cranpose-fonts", "cranpose-fonts/cjk"]
localization = ["cranpose-ui/localization", "cranpose-liquid/localization", "cranpose-services/localization", "dep:sys-locale", "text-shaping"]
localization-formatting = ["localization", "cranpose-ui/localization-formatting"]
text-shaping = ["cranpose-render-common/text-shaping"]
default = ["embedded-default-font"]
# Compiles every crate's debug and trace log calls out of release builds.
# The logger this crate installs on Android passes Info and above, so there
# those calls never print (-150 KB on the Android bench). Opt-in: `log`
# refuses two `release_max_level_*` features, and an app with its own level
# or logger could not turn a framework default off.
release-log-info = ["log/release_max_level_info"]
# Embed the framework's default font (~1.3 MiB), which text draws in when the
# app supplies no fonts. An app that supplies fonts through an AppLauncher
# font method leaves it out of its binary without touching this feature.
embedded-default-font = ["cranpose-render-common/embedded-default-font"]
# GL/GLES fallback backend for the wgpu renderer on native targets. Desktop
# defaults to Vulkan/DX12/Metal only; enable this for machines without a
# working Vulkan driver. Android enables it automatically.
renderer-wgpu-gles = [
    "renderer-wgpu",
    "cranpose-render-wgpu/backend-gles",
]
# Desktop with both display-server backends. Size-sensitive apps can pick
# just one via desktop-x11 / desktop-wayland.
desktop = ["desktop-x11", "desktop-wayland"]
desktop-x11 = [
    "desktop-shell",
    "cranpose-platform-desktop-winit/x11",
    "winit/x11",
    "dep:x11rb",
]
desktop-wayland = [
    "desktop-shell",
    "cranpose-platform-desktop-winit/wayland",
    "winit/wayland",
    "winit/wayland-dlopen",
    "winit/wayland-csd-adwaita",
]
# Internal: the winit desktop shell shared by the per-backend features. Use
# desktop / desktop-x11 / desktop-wayland instead of enabling this directly.
# Enables the desktop service backends (URI opener, file picker, system
# theme) so apps get working services without re-listing cranpose-services
# features themselves.
desktop-shell = [
    "native-windows",
    "cranpose-app-shell/clipboard-native",
    "dep:objc2",
    "dep:objc2-app-kit",
    "dep:windows-sys",
    "cranpose-platform-desktop-winit",
    "dep:winit",
    "dep:accesskit",
    "cranpose-services/uri-native",
    "cranpose-services/file-picker-native",
    "cranpose-services/system-theme",
    "cranpose-services/notifier-native",
]
# Runs the application inside another program's window (an IDE tool window,
# an editor panel): frames are drawn off screen and streamed to the host over
# a loopback socket, and the host sends input back. See `cranpose::embed`.
embed = [
    "dep:serde",
    "dep:serde_json",
    "renderer-wgpu",
    "native-windows",
    "cranpose-app-shell/clipboard-native",
    "cranpose-services/uri-native",
]
# Internal: the registry behind `Modifier::window`, serviced by the desktop
# shell (winit windows) and by `embed` (windows the host creates). Use
# `desktop` or `embed` instead of enabling this directly.
native-windows = []
ios = [
    "dep:cranpose-media",
    "cranpose-platform-desktop-winit",
    "dep:winit",
    "dep:objc2",
    "dep:objc2-foundation",
    "dep:objc2-ui-kit",
    "dep:objc2-uniform-type-identifiers",
    "dep:objc2-user-notifications",
    "dep:block2",
    "dep:dispatch2",
    "dep:objc2-av-foundation",
    "dep:objc2-core-media",
    "dep:objc2-core-video",
    "dep:objc2-core-foundation",
    "dep:objc2-avf-audio",
    "dep:objc2-media-player",
    "dep:oslog",
]
android = [
    "cranpose-platform-android",
    "cranpose-render-wgpu?/backend-gles",
    "cranpose-services/uri-android",
]
web = [
    "cranpose-platform-web",
    "dep:wasm-bindgen",
    "dep:web-sys",
    "dep:js-sys",
    "cranpose-services/uri-web",
    "cranpose-services/file-picker-web",
    "cranpose-services/system-theme-web",
    "cranpose-services/preferences-web",
]
# The real-time audio engine (`cranpose_audio`), registered into
# `cranpose_services::audio`. Off by default: an app that plays no sound should
# not carry a mixer or an output device. On Android this is the AAudio backend,
# which needs no Java glue.
audio = ["dep:cranpose-audio", "cranpose-audio/aaudio"]
# Adds the desktop output device (cpal) so sound works while developing on
# macOS, Windows or Linux. Linux builds need the ALSA development headers.
audio-desktop = ["audio", "cranpose-audio/cpal-backend"]
# Desktop camera capture on macOS, through the same `AVCaptureSession` stack
# the iOS backend uses, so the two share one file. Off by default: an
# application that opens no camera should not link AVFoundation. Linux and
# Windows have no desktop camera backend yet, and there this compiles away.
# A Mac only hands frames to a signed, bundled application carrying
# `NSCameraUsageDescription`; a bare executable is refused by the system, not
# by this code.
camera-desktop = [
    "dep:objc2",
    "dep:block2",
    "dep:dispatch2",
    "dep:objc2-av-foundation",
    "dep:objc2-core-media",
    "dep:objc2-core-video",
]
# The in-process media backend (`cranpose_media`), registered into
# `cranpose_services::media`. Off by default because it links a system audio
# library on desktop (ALSA on Linux, CoreAudio on macOS, WASAPI on Windows) and
# carries the `symphonia` decoders everywhere. On Android it is what decodes:
# the platform's own `MediaPlayer` cannot read a document a provider streams,
# and the Android backend wraps this one with the media session. iOS and the web
# use their platform stack, and there the backend compiles away.
media = ["dep:cranpose-media"]
renderer-pixels = ["cranpose-render-pixels"]
watchos = [
    "renderer-pixels",
    "dep:objc2",
    "dep:objc2-foundation",
    "dep:block2",
    "dep:dispatch2",
    "dep:objc2-avf-audio",
    "dep:objc2-watch-kit",
    "dep:oslog",
]
renderer-wgpu = ["cranpose-render-wgpu", "dep:wgpu", "dep:pollster", "dep:ash"]
# App-defined WGSL RuntimeShaders on the slim renderer (naga at runtime,
# ~0.7 MiB). On by default; drop via `default-features = false` if the app
# uses only framework effects.
robot = ["cranpose-app-shell/test-support"] # Enable robot testing support (cranpose-ui now always included)
# In-app purchases through StoreKit 2 on iOS/macOS, registered into
# `cranpose_services::purchases`. Off by default: it links the StoreKit
# framework and compiles a Swift shim, which an app that sells nothing should
# not pay for. Harmless to enable on non-Apple targets — it compiles away.
storekit = ["dep:cranpose-storekit"]
# Messages and streams between an iPhone app and the same app on its Apple
# Watch through WatchConnectivity, behind `cranpose_services::wearable`. On
# Android the Gradle service "wearable" brings the Wear OS link instead.
wearable = [
    "dep:objc2",
    "dep:objc2-foundation",
    "dep:block2",
    "dep:dispatch2",
    "dep:objc2-watch-connectivity",
]
# In-app purchases through Google Play Billing on Android and Wear OS,
# registered into `cranpose_services::purchases`. Off by default: the bridge
# expects the app's Gradle build to add the Play Billing dependency and the
# `crates/cranpose/android/java-billing` source directory, which an app that
# sells nothing should not carry. Harmless to enable on other targets — the
# whole backend is Android-only and compiles away.
playbilling = []
preview = ["embed", "dep:inventory", "cranpose-ui/inspection"]
# Development-only structural keys for hot-patched previews; the plugin's
# development runner enables it for private debug builds. Release builds and
# the default feature set are unaffected.
hot-reload = ["cranpose-core/hot-reload", "cranpose-macros/hot-reload"]
webview = ["dep:wry", "dep:gtk"]

[dependencies]
cranpose-app-shell = { workspace = true }
cranpose-fonts = { workspace = true, optional = true }
cranpose-audio = { workspace = true, optional = true }
cranpose-core = { workspace = true }
cranpose-foundation = { workspace = true }
cranpose-media = { workspace = true, optional = true }
cranpose-ui = { workspace = true }
cranpose-ui-layout = { workspace = true }
cranpose-platform-desktop-winit = { workspace = true, optional = true }
cranpose-platform-android = { workspace = true, optional = true }
cranpose-platform-web = { workspace = true, optional = true }
cranpose-render-pixels = { workspace = true, optional = true }
cranpose-render-wgpu = { workspace = true, optional = true }
pollster = { version = "0.4.0", optional = true }
winit = { version = "=0.31.0-beta.3", optional = true, default-features = false }
wasm-bindgen = { version = "0.2", optional = true }
web-sys = { version = "0.3", optional = true, features = [
    "Window",
    "Location",
    "Document",
    "Element",
    "HtmlElement",
    "HtmlCanvasElement",
    "HtmlIFrameElement",
    "DomRect",
    "CanvasRenderingContext2d",
    "ImageData",
    "Performance",
    "MouseEvent",
    "EventTarget",
    "Touch",
    "TouchList",
    "TouchEvent",
    "PointerEvent",
    "WheelEvent",
    "KeyboardEvent",
    "CssStyleDeclaration",
    # Clipboard support
    "Navigator",
    "Clipboard",
    "ClipboardEvent",
    "DataTransfer",
    # Dropped files (`web_drop`)
    "DragEvent",
    "FileList",
    # Battery Status API (`web_power`)
    "BatteryManager",
    # IME composition support (hidden textarea + composition events)
    "CompositionEvent",
    "HtmlInputElement",
    "HtmlTextAreaElement",
    "Node",
    # System theme (prefers-color-scheme live updates)
    "MediaQueryList",
    "MediaQueryListEvent",
    # Web Share API
    "ShareData",
    "File",
    "FilePropertyBag",
    # Notifications API
    "Notification",
    "NotificationOptions",
    "NotificationPermission",
    # Media playback (`web_media`): the element, the lock-screen artwork blob,
    # and the Web Audio graph a visualiser reads.
    "HtmlMediaElement",
    "HtmlAudioElement",
    "TimeRanges",
    "Blob",
    "BlobPropertyBag",
    "Url",
    "BaseAudioContext",
    "AudioContext",
    "AudioNode",
    "AudioDestinationNode",
    "AnalyserNode",
    "MediaElementAudioSourceNode",
    "AudioParam",
    "GainNode",
    "ChannelSplitterNode",
    "ChannelMergerNode",
    "ChannelCountMode",
    "BiquadFilterNode",
    "BiquadFilterType",
] }
js-sys = { version = "0.3", optional = true }
log = "0.4"
cranpose-capabilities = { workspace = true }
cranpose-liquid = { workspace = true }
cranpose-services = { workspace = true, default-features = false }
cranpose-storekit = { workspace = true, default-features = false, optional = true }
thiserror = "2.0.21"
web-time = { workspace = true }
cranpose-render-common.workspace = true
raw-window-handle = "0.6"
accesskit = { version = "0.25.1", optional = true }
serde = { version = "1.0.229", features = ["derive"], optional = true }
serde_json = { version = "1.0.151", optional = true }
inventory = { version = "0.3.24", optional = true }
cranpose-macros = { workspace = true }
sys-locale = { version = "0.3.2", features = ["js"], optional = true }

[target.'cfg(target_arch = "wasm32")'.dependencies]
console_error_panic_hook = "0.1"
# Turns the liquid glass material folds on in mobile browsers (`web`).
cranpose-ui-graphics = { workspace = true }
# Awaits the Async Clipboard API's promises (`web_clipboard`).
wasm-bindgen-futures = "0.4"
wgpu = { workspace = true, optional = true, features = [
    "std",
    "webgpu",
    "webgl",
    "wgsl",
] }

# The process readings in `process_info`: `getrusage`, `sysconf`, and on the
# platforms that have them `mallopt` and `os_proc_available_memory`.
[target.'cfg(unix)'.dependencies]
libc = "0.2"

[target.'cfg(target_os = "android")'.dependencies]
android-activity = { workspace = true }
# `VK_GOOGLE_display_timing`'s loader, for `android_display_timing`: wgpu
# enables the extension but does not read its records. The version is
# wgpu-hal's own, so the two share one build.
ash = { version = "0.38", optional = true }
android_logger = "0.15"
jni = "0.22.4"
ndk = "0.9.0"
# Raw AChoreographer bindings for the vsync-phase probe in
# `android_frame_telemetry`; the safe `ndk` crate does not wrap it.
ndk-sys = "0.6.0"
raw-window-handle = "0.6"
zune-core = "0.5.3"
zune-jpeg = "0.5.15"
wgpu = { workspace = true, optional = true, features = [
    "std",
    "parking_lot",
    "vulkan",
] }

[target.'cfg(all(target_os = "linux", not(target_arch = "wasm32")))'.dependencies]
accesskit_unix = { version = "0.24.0", default-features = false, features = ["async-io"] }
x11rb = { version = "0.13.2", optional = true }
wgpu = { workspace = true, optional = true, features = [
    "std",
    "parking_lot",
    "vulkan",
] }

[target.'cfg(target_os = "windows")'.dependencies]
accesskit_windows = "0.35.1"
# The pointer size the person chose (`windows_cursor`), which custom cursors
# are scaled to. The version winit already resolves.
windows-sys = { version = "0.61", optional = true, features = ["Win32_System_Registry"] }
wgpu = { workspace = true, optional = true, features = [
    "std",
    "parking_lot",
    "dx12",
] }

# Both Apple targets, which share a kernel and therefore share these.
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
# Raw Mach task-info bindings, used by `process_info.rs` to read this
# process's resident memory: Darwin has no `/proc` for a process to read its
# own footprint from, so the Linux/Android path's `/proc/self/statm` has no
# Apple equivalent short of the same kernel call every Instruments memory
# gauge uses.
mach2 = "0.6.0"

[target.'cfg(target_os = "macos")'.dependencies]
accesskit_macos = "0.27.1"
# Thermal pressure. `NSProcessInfo` is Foundation rather than UIKit, so the
# reading a Mac gives is the same one iOS gives and needs no second mapping.
# The collection types below that are the camera's (`camera-desktop`): this
# entry is not optional, so the classes it names are listed here rather than
# added by the feature.
objc2-foundation = { version = "0.3", default-features = false, features = [
    "std",
    "NSArray",
    "NSDictionary",
    "NSEnumerator",
    "NSError",
    "NSObject",
    "NSGeometry",
    "NSProcessInfo",
    "NSString",
    "NSUserDefaults",
    "NSValue",
] }
# Custom cursors that keep the size they were drawn at (`macos_cursor`), which
# winit cannot build. The version winit already resolves.
objc2-app-kit = { version = "0.3", default-features = false, optional = true, features = [
    "std",
    "NSBitmapImageRep",
    "NSCursor",
    "NSGraphics",
    "NSImage",
    "NSImageRep",
    "NSResponder",
    "NSView",
    "NSWindow",
] }
# The macOS half of the AVFoundation camera (`camera-desktop`). Same crates
# and same versions the iOS backend takes, so a Mac build adds no dependency
# the workspace does not already resolve.
objc2 = { version = "0.6", optional = true }
block2 = { version = "0.6", optional = true }
dispatch2 = { version = "0.3", optional = true }
objc2-av-foundation = { version = "0.3", default-features = false, optional = true, features = [
    "dispatch2",
    "std",
    "block2",
    "objc2-core-media",
    "AVCaptureSession",
    "AVCaptureSessionPreset",
    "AVCaptureDevice",
    "AVCaptureInput",
    "AVCaptureOutput",
    "AVCaptureOutputBase",
    "AVCaptureVideoDataOutput",
    "AVCapturePhotoOutput",
    "AVMediaFormat",
    "AVVideoSettings",
] }
objc2-core-media = { version = "0.3", default-features = false, optional = true, features = [
    "std",
    "objc2-core-video",
    "CMSampleBuffer",
] }
objc2-core-video = { version = "0.3", default-features = false, optional = true, features = [
    "std",
    "CVBase",
    "CVPixelBuffer",
    "CVImageBuffer",
    "CVBuffer",
    "CVReturn",
] }
wgpu = { workspace = true, optional = true, features = [
    "std",
    "parking_lot",
    "metal",
] }

[target.'cfg(target_os = "ios")'.dependencies]
wgpu = { workspace = true, optional = true, features = [
    "std",
    "parking_lot",
    "metal",
] }
# iOS file picker (UIDocumentPickerViewController). Only pulled in with the
# `ios` feature.
objc2 = { version = "0.6", optional = true }
objc2-foundation = { version = "0.3", default-features = false, optional = true, features = [
    "std",
    "NSArray",
    "NSData",
    "NSDictionary",
    "NSEnumerator",
    "NSError",
    "NSNotification",
    "NSObject",
    "NSBundle",
    "NSPathUtilities",
    "NSProcessInfo",
    "NSSet",
    "NSString",
    "NSURL",
    "NSValue",
] }
objc2-ui-kit = { version = "0.3", default-features = false, optional = true, features = [
    "std",
    "block2",
    "objc2-core-foundation",
    "objc2-uniform-type-identifiers",
    "UIGeometry",
    "UIScreen",
    "UIActivity",
    "UIActivityViewController",
    "UIAccessibility",
    "UIAccessibilityAdditions",
    "UIAccessibilityConstants",
    "UIAccessibilityContainer",
    "UIAccessibilityCustomAction",
    "UIAccessibilityElement",
    "UIAccessibilityIdentification",
    "UIApplication",
    "UIContentSizeCategory",
    "UIControl",
    "UIDevice",
    "UIDocumentPickerViewController",
    "UIFeedbackGenerator",
    "UIImage",
    "UIImagePickerController",
    "UIImpactFeedbackGenerator",
    "UINavigationController",
    "UINotificationFeedbackGenerator",
    "NSText",
    "UIPasteboard",
    "UIPopoverPresentationController",
    "UIPresentationController",
    "UIResponder",
    "UIGestureRecognizerSubclass",
    "UIScreenEdgePanGestureRecognizer",
    "UIGestureRecognizer",
    "UIPanGestureRecognizer",
    "UIScene",
    "UISceneOptions",
    "UISceneSession",
    "UISelectionFeedbackGenerator",
    "UITextField",
    "UITextInput",
    "UITextInput",
    "UITextInputTraits",
    "UIKeyboardLayoutGuide",
    "UILayoutGuide",
    "UITrackingLayoutGuide",
    "UIView",
    "UIViewController",
    "UIWindow",
    "UIWindowScene",
] }
objc2-uniform-type-identifiers = { version = "0.3", default-features = false, optional = true, features = [
    "std",
    "UTCoreTypes",
    "UTType",
] }
block2 = { version = "0.6", optional = true }
dispatch2 = { version = "0.3", optional = true }
objc2-core-foundation = { version = "0.3", default-features = false, optional = true, features = ["std", "CFCGTypes"] }
objc2-av-foundation = { version = "0.3", default-features = false, optional = true, features = [
    "dispatch2",
    "std",
    "block2",
    "objc2-core-media",
    "AVCaptureSession",
    "AVCaptureSessionPreset",
    "AVCaptureDevice",
    "AVCaptureInput",
    "AVCaptureOutput",
    "AVCaptureOutputBase",
    "AVCaptureVideoDataOutput",
    "AVCapturePhotoOutput",
    "AVMediaFormat",
    "AVVideoSettings",
    # Media playback (`ios_media`): AVPlayer streams a remote item as well as a
    # local one, and the asset is what answers a duration probe.
    "AVAsset",
    "AVPlayer",
    "AVPlayerItem",
] }
objc2-core-media = { version = "0.3", default-features = false, optional = true, features = [
    "std",
    "objc2-core-video",
    "CMSampleBuffer",
    "CMTime",
] }
objc2-core-video = { version = "0.3", default-features = false, optional = true, features = [
    "std",
    "CVBase",
    "CVPixelBuffer",
    "CVImageBuffer",
    "CVBuffer",
    "CVReturn",
] }
objc2-user-notifications = { version = "0.3", default-features = false, optional = true, features = [
    "std",
    "block2",
    "UNUserNotificationCenter",
    "UNNotification",
    "UNNotificationRequest",
    "UNNotificationContent",
    "UNNotificationResponse",
    "UNNotificationSound",
    "UNNotificationTrigger",
    "UNError",
] }
# Media playback (`ios_media`): AVAudioSession for the category and the
# interruptions, and MediaPlayer for the lock screen and the remote commands.
objc2-avf-audio = { version = "0.3.2", default-features = false, optional = true, features = [
    "std",
    "block2",
    "AVAudioSession",
    "AVAudioSessionRoute",
    "AVAudioSessionTypes",
] }
# The unified system log, which `log` records go to (`apple_mobile`).
oslog = { version = "0.2", default-features = false, optional = true }
# The link between an iPhone app and its watch app (`wearable`).
objc2-watch-connectivity = { version = "0.3.2", default-features = false, optional = true, features = [
    "std",
    "block2",
    "WCSession",
] }
objc2-media-player = { version = "0.3.2", default-features = false, optional = true, features = [
    "std",
    "block2",
    "MPMediaItem",
    "MPNowPlayingInfoCenter",
    "MPRemoteCommand",
    "MPRemoteCommandCenter",
    "MPRemoteCommandEvent",
] }

[target.'cfg(target_os = "watchos")'.dependencies]
# The watchOS host's services (`watchos_services`), with the iOS host's
# microphone session and, under `wearable`, its link to the phone.
objc2 = { version = "0.6", optional = true }
objc2-foundation = { version = "0.3", default-features = false, optional = true, features = [
    "std",
    "block2",
    "NSBundle",
    "NSData",
    "NSError",
    "NSObject",
    "NSPathUtilities",
    "NSString",
] }
block2 = { version = "0.6", optional = true }
dispatch2 = { version = "0.3", optional = true }
objc2-avf-audio = { version = "0.3.2", default-features = false, optional = true, features = [
    "std",
    "block2",
    "AVAudioSession",
    "AVAudioSessionTypes",
] }
objc2-watch-connectivity = { version = "0.3.2", default-features = false, optional = true, features = [
    "std",
    "block2",
    "WCSession",
] }
oslog = { version = "0.2", default-features = false, optional = true }
objc2-watch-kit = { version = "0.3.2", default-features = false, optional = true, features = [
    "std",
    "WKInterfaceDevice",
] }

[target.'cfg(all(not(target_arch = "wasm32"), not(target_os = "android"), not(target_os = "linux"), not(target_os = "windows"), not(target_os = "macos"), not(target_os = "ios")))'.dependencies]
wgpu = { workspace = true, optional = true, features = [
    "std",
    "parking_lot",
    "vulkan",
] }

[target.'cfg(any(target_os = "macos", target_os = "windows", target_os = "linux", target_os = "ios"))'.dependencies]
wry = { version = "0.57", default-features = false, features = ["os-webview", "x11"], optional = true }

[target.'cfg(target_os = "linux")'.dependencies]
gtk = { version = "0.18.2", optional = true }

[dev-dependencies]
# Path-only dev-dep: stripped from the published manifest. Turns on the
# workspace's shared test scratch directory for this crate's own tests.
cranpose-core = { path = "../cranpose-core", features = ["test-helpers"] }
cranpose-runtime-std = { path = "../cranpose-runtime-std" }

[[test]]
name = "integration"
path = "tests/integration.rs"

[[example]]
name = "localization"
path = "examples/localization.rs"
required-features = ["desktop", "renderer-wgpu", "localization"]