This builds upon built ... pun intended :)
Add the following to Cargo.toml: ```toml [package] build = "build.rs"
[build-dependencies] oysterpack_built = "0.1.0" ```
Include the following in build.rs:
Libraries ```rust extern crate oysterpack_built;
fn main() { oysterpackbuilt::writelibbuiltfile().expect("Failed to acquire build-time information"); } ```
Applications ```rust extern crate oysterpack_built;
fn main() { oysterpackbuilt::writeappbuiltfile().expect("Failed to acquire build-time information"); } ```
The build script will by default write a file named built.rs into Cargo's output directory. It can be picked up like this:
rust
// Use of a mod or pub mod is not actually necessary.
pub mod build {
// The file has been placed there by the build script.
include!(concat!(env!("OUT_DIR"), "/built.rs"));
}