From 8255c38d6341237303dd6324e1f973b6432a2e3e Mon Sep 17 00:00:00 2001 From: Elliott Slaughter Date: Thu, 19 Sep 2024 13:58:11 -0700 Subject: [PATCH] Generate source path so it can be looked up later. --- Cargo.toml | 7 ++++++- build.rs | 11 +++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 build.rs diff --git a/Cargo.toml b/Cargo.toml index 34ab637..334b54d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,12 @@ categories = ["development-tools::profiling"] license = "Apache-2.0" edition = "2021" -rust-version = "1.74" +rust-version = "1.77" + +# Required to ensure metadata is visible to dependents. See: +# https://doc.rust-lang.org/cargo/reference/build-scripts.html +# https://github.com/rust-lang/cargo/issues/7846 +links="legion_prof_viewer" [features] default = [] diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..accd992 --- /dev/null +++ b/build.rs @@ -0,0 +1,11 @@ +use std::env; + +fn main() { + let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); + println!("cargo::metadata=SOURCE={}", manifest_dir); + + // Don't rerun, we don't actually depend on anything + println!("cargo::rerun-if-changed=build.rs"); + + println!("cargo::warning=Saving path: {}", manifest_dir) +}