summaryrefslogtreecommitdiffstats
path: root/library/profiler_builtins/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'library/profiler_builtins/build.rs')
-rw-r--r--library/profiler_builtins/build.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/library/profiler_builtins/build.rs b/library/profiler_builtins/build.rs
index 1b1f11798..d14d0b822 100644
--- a/library/profiler_builtins/build.rs
+++ b/library/profiler_builtins/build.rs
@@ -6,6 +6,12 @@ use std::env;
use std::path::Path;
fn main() {
+ println!("cargo:rerun-if-env-changed=LLVM_PROFILER_RT_LIB");
+ if let Ok(rt) = env::var("LLVM_PROFILER_RT_LIB") {
+ println!("cargo:rustc-link-lib=static:+verbatim={rt}");
+ return;
+ }
+
let target = env::var("TARGET").expect("TARGET was not set");
let cfg = &mut cc::Build::new();