@@ -175,6 +175,8 @@ pub struct Header {
175175 pub have_direct : bool ,
176176 pub have_parallel : bool ,
177177 pub have_threadsafe : bool ,
178+ pub have_zlib : bool ,
179+ pub have_no_deprecated : bool ,
178180 pub version : Version ,
179181}
180182
@@ -200,6 +202,10 @@ impl Header {
200202 hdr. have_parallel = value > 0 ;
201203 } else if name == "H5_HAVE_THREADSAFE" {
202204 hdr. have_threadsafe = value > 0 ;
205+ } else if name == "H5_HAVE_FILTER_DEFLATE" {
206+ hdr. have_zlib = value > 0 ;
207+ } else if name == "H5_NO_DEPRECATED_SYMBOLS" {
208+ hdr. have_no_deprecated = value > 0 ;
203209 }
204210 }
205211
@@ -611,6 +617,7 @@ impl LibrarySearcher {
611617 if !( self . pkg_conf_found && cfg ! ( windows) ) {
612618 validate_runtime_version ( & config) ;
613619 }
620+ config. check_against_features_required ( ) ;
614621 config
615622 } else {
616623 panic ! ( "Unable to determine HDF5 location (set HDF5_DIR to specify it manually)." ) ;
@@ -675,6 +682,24 @@ impl Config {
675682 println ! ( "cargo:have_threadsafe=1" ) ;
676683 }
677684 }
685+
686+ fn check_against_features_required ( & self ) {
687+ if feature_enabled ( "DEPRECATED" ) {
688+ assert ! ( !self . header. have_no_deprecated, "Required deprecated symbols are not present" )
689+ }
690+ if feature_enabled ( "THREADSAFE" ) {
691+ assert ! (
692+ self . header. have_threadsafe,
693+ "Required threadsafe but library was not build using the threadsafe option"
694+ ) ;
695+ }
696+ if feature_enabled ( "ZLIB" ) {
697+ assert ! (
698+ self . header. have_zlib,
699+ "Required zlib filter but library does not have builtin support for this options"
700+ ) ;
701+ }
702+ }
678703}
679704
680705fn main ( ) {
0 commit comments