@@ -168,6 +168,8 @@ pub struct Header {
168168 pub have_direct : bool ,
169169 pub have_parallel : bool ,
170170 pub have_threadsafe : bool ,
171+ pub have_zlib : bool ,
172+ pub have_no_deprecated : bool ,
171173 pub version : Version ,
172174}
173175
@@ -193,6 +195,10 @@ impl Header {
193195 hdr. have_parallel = value > 0 ;
194196 } else if name == "H5_HAVE_THREADSAFE" {
195197 hdr. have_threadsafe = value > 0 ;
198+ } else if name == "H5_HAVE_FILTER_DEFLATE" {
199+ hdr. have_zlib = value > 0 ;
200+ } else if name == "H5_NO_DEPRECATED_SYMBOLS" {
201+ hdr. have_no_deprecated = value > 0 ;
196202 }
197203 }
198204
@@ -571,6 +577,7 @@ impl LibrarySearcher {
571577 }
572578 let config = Config { inc_dir : inc_dir. clone ( ) , link_paths, header } ;
573579 validate_runtime_version ( & config) ;
580+ config. check_against_features_required ( ) ;
574581 config
575582 } else {
576583 panic ! ( "Unable to determine HDF5 location (set HDF5_DIR to specify it manually)." ) ;
@@ -634,6 +641,24 @@ impl Config {
634641 println ! ( "cargo:have_threadsafe=1" ) ;
635642 }
636643 }
644+
645+ fn check_against_features_required ( & self ) {
646+ if feature_enabled ( "DEPRECATED" ) {
647+ assert ! ( !self . header. have_no_deprecated, "Required deprecated symbols are not present" )
648+ }
649+ if feature_enabled ( "THREADSAFE" ) {
650+ assert ! (
651+ self . header. have_threadsafe,
652+ "Required threadsafe but library was not build using the threadsafe option"
653+ ) ;
654+ }
655+ if feature_enabled ( "ZLIB" ) {
656+ assert ! (
657+ self . header. have_zlib,
658+ "Required zlib filter but library does not have builtin support for this options"
659+ ) ;
660+ }
661+ }
637662}
638663
639664fn main ( ) {
0 commit comments