File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -22,5 +22,8 @@ cxx-build = "1.0"
2222glob = " 0.3"
2323cc = " 1.0"
2424
25+ [target .'cfg(target_os = "linux")' .build-dependencies ]
26+ pkg-config = " 0.3.22"
27+
2528[dev-dependencies ]
2629env_logger = " 0.10"
Original file line number Diff line number Diff line change @@ -155,13 +155,21 @@ fn main() {
155155 println ! ( "cargo:rustc-link-lib=dylib=pthread" ) ;
156156 println ! ( "cargo:rustc-link-lib=dylib=m" ) ;
157157
158- println ! ( "cargo:rustc-link-lib=dylib=glib-2.0" ) ;
159- println ! ( "cargo:rustc-link-lib=dylib=gobject-2.0" ) ;
160- println ! ( "cargo:rustc-link-lib=dylib=gio-2.0" ) ;
161- println ! ( "cargo:rustc-link-lib=dylib=drm" ) ;
162- println ! ( "cargo:rustc-link-lib=dylib=gbm" ) ;
158+ if std:: env:: var ( "LK_CUSTOM_WEBRTC" ) . is_ok ( ) {
159+ for lib_name in [ "glib-2.0" , "gobject-2.0" , "gio-2.0" ] {
160+ let lib = pkg_config:: probe_library ( lib_name) . unwrap ( ) ;
161+ builder. includes ( lib. include_paths ) ;
162+ }
163+ } else {
164+ println ! ( "cargo:rustc-link-lib=dylib=glib-2.0" ) ;
165+ println ! ( "cargo:rustc-link-lib=dylib=gobject-2.0" ) ;
166+ println ! ( "cargo:rustc-link-lib=dylib=gio-2.0" ) ;
167+ add_gio_headers ( & mut builder) ;
168+ }
163169
164- add_gio_headers ( & mut builder) ;
170+ for lib_name in [ "libdrm" , "gbm" ] {
171+ pkg_config:: probe_library ( lib_name) . unwrap ( ) ;
172+ }
165173
166174 match target_arch. as_str ( ) {
167175 "x86_64" => {
You can’t perform that action at this time.
0 commit comments