File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ workspace = true
1313thiserror = " 2"
1414log = " 0.4"
1515
16- env_logger = " 0.11"
17-
1816[build-dependencies ]
1917bindgen = " 0.72"
18+ pkg-config = " 0.3"
Original file line number Diff line number Diff line change 11use std:: env;
22
33fn main ( ) {
4- println ! ( "cargo:rustc-link-lib=va" ) ;
5- println ! ( "cargo:rustc-link-lib=va- drm") ;
4+ let libva = pkg_config :: probe_library ( "libva" ) . unwrap ( ) ;
5+ let libva_drm = pkg_config :: probe_library ( "libva- drm") . unwrap ( ) ;
66
7- bindgen:: Builder :: default ( )
8- . header ( "/usr/include/va/va.h" )
9- . header ( "/usr/include/va/va_drm.h" )
7+ for lib in libva. libs . into_iter ( ) . chain ( libva_drm. libs ) {
8+ println ! ( "cargo:rustc-link-lib={lib}" ) ;
9+ }
10+
11+ let mut bindgen = bindgen:: Builder :: default ( ) ;
12+
13+ for include_path in libva
14+ . include_paths
15+ . into_iter ( )
16+ . chain ( libva_drm. include_paths )
17+ {
18+ bindgen = bindgen. clang_arg ( format ! ( "-I{}" , include_path. to_string_lossy( ) ) ) ;
19+ }
20+
21+ bindgen
22+ . header ( "wrapper.h" )
1023 . allowlist_function ( "(va|VA).*" )
1124 . allowlist_type ( "(va|VA).*" )
1225 . allowlist_var ( "(va|VA).*" )
Original file line number Diff line number Diff line change 1+
2+ #include <va/va.h>
3+ #include <va/va_drm.h>
You can’t perform that action at this time.
0 commit comments