@@ -46,19 +46,6 @@ fn main() {
46
46
let android = target. contains ( "android" ) ;
47
47
let mut cfg = cmake:: Config :: new ( "libcubeb" ) ;
48
48
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
-
62
49
if darwin {
63
50
let cmake_osx_arch = if target. contains ( "aarch64" ) {
64
51
// Apple Silicon
@@ -83,9 +70,10 @@ fn main() {
83
70
. define ( "BUILD_RUST_LIBS" , "ON" )
84
71
. build ( ) ;
85
72
73
+ let debug = env:: var ( "DEBUG" ) . unwrap ( ) . parse :: < bool > ( ) . unwrap ( ) ;
74
+
86
75
println ! ( "cargo:rustc-link-lib=static=cubeb" ) ;
87
76
if windows {
88
- let debug = env:: var ( "DEBUG" ) . unwrap ( ) . parse :: < bool > ( ) . unwrap ( ) ;
89
77
println ! ( "cargo:rustc-link-lib=dylib=avrt" ) ;
90
78
println ! ( "cargo:rustc-link-lib=dylib=ksuser" ) ;
91
79
println ! ( "cargo:rustc-link-lib=dylib=ole32" ) ;
@@ -100,11 +88,17 @@ fn main() {
100
88
println ! ( "cargo:rustc-link-lib=framework=CoreAudio" ) ;
101
89
println ! ( "cargo:rustc-link-lib=framework=CoreServices" ) ;
102
90
println ! ( "cargo:rustc-link-lib=dylib=c++" ) ;
91
+
103
92
println ! ( "cargo:rustc-link-lib=static=cubeb_coreaudio" ) ;
104
93
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
+ }
107
100
println ! ( "cargo:rustc-link-search=native={}" , search_path. display( ) ) ;
101
+
108
102
println ! ( "cargo:rustc-link-search=native={}/lib" , dst. display( ) ) ;
109
103
} else {
110
104
if freebsd || android {
@@ -118,11 +112,15 @@ fn main() {
118
112
// Ignore the result of find_library. We don't care if the
119
113
// libraries are missing.
120
114
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 ( ) {
122
116
println ! ( "cargo:rustc-link-lib=static=cubeb_pulse" ) ;
123
117
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
+ }
126
124
println ! ( "cargo:rustc-link-search=native={}" , search_path. display( ) ) ;
127
125
}
128
126
let _ = pkg_config:: find_library ( "jack" ) ;
0 commit comments