Skip to content

Commit 374f409

Browse files
Update libcubeb to 2bee6bc.
This change only grabs the rust backends for pulse and audiounit. So, also stop manually cloning.
1 parent 0d2c1d3 commit 374f409

File tree

2 files changed

+18
-20
lines changed

2 files changed

+18
-20
lines changed

cubeb-sys/build.rs

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,6 @@ fn main() {
4646
let android = target.contains("android");
4747
let mut cfg = cmake::Config::new("libcubeb");
4848

49-
// Also clone better-supported rust backends.
50-
if darwin {
51-
let _ = Command::new("git")
52-
.args(["clone", "https://github.com/mozilla/cubeb-coreaudio-rs.git"])
53-
.current_dir("libcubeb/src")
54-
.status();
55-
} else if !windows {
56-
let _ = Command::new("git")
57-
.args(["clone", "https://github.com/mozilla/cubeb-pulse-rs"])
58-
.current_dir("libcubeb/src")
59-
.status();
60-
}
61-
6249
if darwin {
6350
let cmake_osx_arch = if target.contains("aarch64") {
6451
// Apple Silicon
@@ -83,9 +70,10 @@ fn main() {
8370
.define("BUILD_RUST_LIBS", "ON")
8471
.build();
8572

73+
let debug = env::var("DEBUG").unwrap().parse::<bool>().unwrap();
74+
8675
println!("cargo:rustc-link-lib=static=cubeb");
8776
if windows {
88-
let debug = env::var("DEBUG").unwrap().parse::<bool>().unwrap();
8977
println!("cargo:rustc-link-lib=dylib=avrt");
9078
println!("cargo:rustc-link-lib=dylib=ksuser");
9179
println!("cargo:rustc-link-lib=dylib=ole32");
@@ -100,11 +88,17 @@ fn main() {
10088
println!("cargo:rustc-link-lib=framework=CoreAudio");
10189
println!("cargo:rustc-link-lib=framework=CoreServices");
10290
println!("cargo:rustc-link-lib=dylib=c++");
91+
10392
println!("cargo:rustc-link-lib=static=cubeb_coreaudio");
10493
let mut search_path = std::env::current_dir().unwrap();
105-
// TODO: Also allow for debug?
106-
search_path.push("libcubeb/src/cubeb-coreaudio-rs/target/release");
94+
search_path.push("libcubeb/src/cubeb-coreaudio-rs/target");
95+
if debug {
96+
search_path.push("debug");
97+
} else {
98+
search_path.push("release");
99+
}
107100
println!("cargo:rustc-link-search=native={}", search_path.display());
101+
108102
println!("cargo:rustc-link-search=native={}/lib", dst.display());
109103
} else {
110104
if freebsd || android {
@@ -118,11 +112,15 @@ fn main() {
118112
// Ignore the result of find_library. We don't care if the
119113
// libraries are missing.
120114
let _ = pkg_config::find_library("alsa");
121-
if pkg_config::find_library("libpulse").is_ok() || true {
115+
if pkg_config::find_library("libpulse").is_ok() {
122116
println!("cargo:rustc-link-lib=static=cubeb_pulse");
123117
let mut search_path = std::env::current_dir().unwrap();
124-
// TODO: Also allow for debug?
125-
search_path.push("libcubeb/src/cubeb-pulse/target/release");
118+
search_path.push("libcubeb/src/cubeb-pulse/target");
119+
if debug {
120+
search_path.push("debug");
121+
} else {
122+
search_path.push("release");
123+
}
126124
println!("cargo:rustc-link-search=native={}", search_path.display());
127125
}
128126
let _ = pkg_config::find_library("jack");

0 commit comments

Comments
 (0)