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
//! Derives this crate's own copy of the `exec_backend` / `tokio_backend` cfg.
//!
//! The seam itself lives in `epics-libcom-rs` (whose `build.rs` is the
//! original of this one). This crate still needs the predicate because code
//! *above* the seam gates on it too — `server::scan` sizes its periodic-scan
//! threads differently on the reactor-free backend — and a cfg set by a
//! dependency's build script is not visible here. Each crate that declares
//! `rtems-exec-model` deriving its own cfg from the same two inputs is the
//! existing pattern in this workspace (`epics-ca-rs`, `epics-pva-rs`).
//!
//! Two copies of a predicate is two chances to disagree, so they are pinned:
//! `lib.rs` carries
//! `const _: () = assert!(epics_libcom_rs::EXEC_BACKEND == cfg!(exec_backend))`,
//! which fails to compile if this crate's `rtems-exec-model` ever stops
//! forwarding to the runtime crate's.
//!
//! * `exec_backend` — the std-thread background executor. The only option on
//! `epics_embedded_target` (RTEMS or VxWorks — no tokio reactor on
//! either), and — via the `rtems-exec-model` cargo feature — the
//! host-selectable RTEMS execution model.
//! * `tokio_backend` — the tokio runtime. The hosted default (feature off,
//! non-embedded target).
//!
//! Exactly one of the two is set for any build.