node-app-sdk-rust 7.6.210

Rust SDK for building Node-App native plugins (cdylib) — Lightning-powered marketplace nodes
Documentation
//! Link flags for this package's own tests.
//!
//! ADR-314 contract C1: the SDK reaches the host's thread hooks with
//! `dlsym(RTLD_DEFAULT, …)`, which only resolves symbols that are in the
//! *dynamic* symbol table. Test binaries that export stub
//! `node_host_thread_bind_v1` / `node_host_thread_unbind_v1` symbols
//! (`sdk/rust/tests/*_present.rs`) would otherwise be stripped of them and
//! the "hooks present" tests could not tell themselves apart from the
//! "hooks absent" ones.
//!
//! `rustc-link-arg-tests` applies to test targets only: a shipped app
//! cdylib links exactly as it did before this file existed.
fn main() {
    let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
    match target_os.as_str() {
        "linux" => {
            // `dlsym` lives in libdl on glibc before 2.34, and pulling it in
            // explicitly costs nothing on newer glibc.
            println!("cargo:rustc-link-lib=dl");
            println!("cargo:rustc-link-arg-tests=-Wl,--export-dynamic");
        }
        "macos" => println!("cargo:rustc-link-arg-tests=-Wl,-export_dynamic"),
        _ => {}
    }
}