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
//! Build script for the safe `transcribe-cpp` crate.
//!
//! The native build and link live entirely in `transcribe-cpp-sys`; this script
//! exists only to carry two pieces of that crate's `links` metadata onto the
//! safe crate's OWN test/example/bin link line — `cargo:rustc-link-arg` does
//! NOT propagate from a dependency's build script to its dependents, so the
//! rpath the sys crate emits for itself never reaches here on its own.
//!
//! 1. **shared-lib rpath.** In the `shared` posture the consumer binary must
//! find `libtranscribe` at runtime. On Unix that is an rpath to the sys
//! crate's installed lib dir (`DEP_TRANSCRIBE_LIB_DIR`); Windows has no
//! rpath (the DLL resolves via PATH / the exe dir) so nothing is emitted —
//! a Windows shared consumer puts the lib dir on PATH instead.
//!
//! In the default static posture this branch is inert (no shared lib), so this
//! script is a near no-op.
use env;
use Path;