From 0e67a6d7c428bbb6d9bce2c1273ffbc86ff89d12 Mon Sep 17 00:00:00 2001 From: Luca Barbato Date: Mon, 2 Sep 2024 16:31:30 +0200 Subject: [PATCH] Always print the PKG_CONFIG_PATH in verbose mode This way is possible to do ``` $ export `cargo cbuild -v 2>&1 | grep PKG_CONFIG_PATH | cut -f 2 -d ' '` ``` To use the pkg-config file in uninstalled mode. --- src/build.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/build.rs b/src/build.rs index 273efc18..32c4ea1c 100644 --- a/src/build.rs +++ b/src/build.rs @@ -66,8 +66,6 @@ fn copy_prebuilt_include_file( ) -> anyhow::Result<()> { let mut shell = ws.gctx().shell(); shell.status("Populating", "uninstalled header directory")?; - let path = &format!("PKG_CONFIG_PATH=\"{}\"", root_output.display()); - shell.verbose(move |s| s.note(path))?; for (from, to) in build_targets.extra.include.iter() { let to = root_output.join("include").join(to); create_dir_all(to.parent().unwrap())?; @@ -1244,6 +1242,11 @@ pub fn cbuild( // It is not a new build, recover the static_libs value from the cache cpkg.finger_print.static_libs = cpkg.finger_print.load_previous()?.static_libs; } + + ws.gctx().shell().verbose(|s| { + let path = &format!("PKG_CONFIG_PATH=\"{}\"", root_output.display()); + s.note(path) + })?; } Ok((members, compile_opts))