-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable dlopen feature with env var RUST_JACK_DLOPEN
- Loading branch information
Showing
3 changed files
with
23 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
fn main() { | ||
println!("cargo:rerun-if-env-changed=RUST_JACK_DLOPEN"); | ||
let dlopen = std::env::var("RUST_JACK_DLOPEN").is_ok(); | ||
if dlopen { | ||
println!("cargo:rustc-cfg=feature=\"dlopen\""); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
fn main() { | ||
// pkg-config is required to find PipeWire's implementation of libjack | ||
// Refer to https://github.com/RustAudio/rust-jack/issues/142 for details. | ||
// Do not unwrap this because linking might still work if pkg-config is | ||
// not installed, for example on Windows. | ||
#[cfg(not(feature = "dlopen"))] | ||
let _ = pkg_config::probe_library("jack"); | ||
println!("cargo:rerun-if-env-changed=RUST_JACK_DLOPEN"); | ||
let dlopen = std::env::var("RUST_JACK_DLOPEN").is_ok(); | ||
if dlopen { | ||
println!("cargo:rustc-cfg=feature=\"dlopen\""); | ||
} | ||
if !(dlopen || cfg!(feature = "dlopen")) { | ||
// pkg-config is required to find PipeWire's implementation of libjack | ||
// Refer to https://github.com/RustAudio/rust-jack/issues/142 for details. | ||
// Do not unwrap this because linking might still work if pkg-config is | ||
// not installed, for example on Windows. | ||
pkg_config::find_library("jack").unwrap(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters