File tree Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Expand file tree Collapse file tree 1 file changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -124,17 +124,19 @@ fn main() {
124124mod vcpkg_dep {
125125 use crate :: ProbedLib ;
126126 pub fn vcpkg_find_libxml2 ( ) -> Option < ProbedLib > {
127- if let Ok ( mut metadata) = vcpkg:: Config :: new ( ) . find_package ( "libxml2" ) {
128- if let Some ( mut include_path) = metadata. include_paths . pop ( ) {
129- if include_path. join ( "libxml2" ) . exists ( ) {
130- // libxml2 >= 2.14.5 is in a 'libxml2' subdirectory
131- include_path = include_path. join ( "libxml2" ) ;
132- }
133- return Some ( ProbedLib {
134- version : vcpkg_version ( ) ,
135- include_paths : vec ! [ include_path] ,
127+ if let Ok ( metadata) = vcpkg:: Config :: new ( ) . find_package ( "libxml2" ) {
128+ let include_paths = metadata
129+ . include_paths
130+ . into_iter ( )
131+ . fold ( Vec :: new ( ) , |mut acc, p| {
132+ acc. push ( p. join ( "libxml2" ) ) ;
133+ acc. push ( p) ;
134+ acc
136135 } ) ;
137- }
136+ return Some ( ProbedLib {
137+ version : vcpkg_version ( ) ,
138+ include_paths,
139+ } ) ;
138140 }
139141 None
140142 }
You can’t perform that action at this time.
0 commit comments