From 80d72cf157785e5897dddb8bc5074e6a89c2a8cd Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Wed, 9 Nov 2022 15:09:42 +0100 Subject: [PATCH] Fix being run from rust-analyzer with a clean environment Detect that we're being run from rust-analyzer and don't link to C++ libraries in that case. Fixes #6019. --- src/rust-bridge/test/build.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/rust-bridge/test/build.rs b/src/rust-bridge/test/build.rs index 286fc1813..bdb269929 100644 --- a/src/rust-bridge/test/build.rs +++ b/src/rust-bridge/test/build.rs @@ -19,7 +19,8 @@ fn main() { println!("cargo:rerun-if-env-changed=DDNET_TEST_LIBRARIES"); println!("cargo:rerun-if-env-changed=DDNET_TEST_NO_LINK"); - if env::var_os("DDNET_TEST_NO_LINK").is_some() { + println!("cargo:rerun-if-env-changed=RA_RUSTC_WRAPPER"); + if env::var_os("DDNET_TEST_NO_LINK").is_some() || env::var_os("RA_RUSTC_WRAPPER").is_some() { return; } if env::var_os("CARGO_FEATURE_LINK_TEST_LIBRARIES").is_some() {