@@ -11,7 +11,10 @@ use collector::Collector;
11
11
use opencv_binding_generator:: { Generator , IteratorExt , SupportedModule } ;
12
12
13
13
use super :: docs:: transfer_bindings_to_docs;
14
- use super :: { files_with_predicate, Library , Result , OUT_DIR , SRC_CPP_DIR , SRC_DIR , SUPPORTED_MODULES , SUPPORTED_OPENCV_BRANCHES } ;
14
+ use super :: {
15
+ files_with_predicate, Library , Result , OUT_DIR , SRC_CPP_DIR , SRC_DIR , SUPPORTED_INHERENT_FEATURES , SUPPORTED_MODULES ,
16
+ SUPPORTED_OPENCV_BRANCHES ,
17
+ } ;
15
18
16
19
#[ path = "generator/collector.rs" ]
17
20
mod collector;
@@ -71,6 +74,7 @@ impl<'r> BindingGenerator<'r> {
71
74
. collect_bindings ( ) ?;
72
75
self . generate_opencv_branch_cond_macros ( ) ?;
73
76
self . generate_opencv_module_cond_macros ( ) ?;
77
+ self . generate_opencv_inherent_feature_cond_macros ( ) ?;
74
78
75
79
if let Some ( target_docs_dir) = target_docs_dir {
76
80
if !target_docs_dir. exists ( ) {
@@ -102,6 +106,21 @@ impl<'r> BindingGenerator<'r> {
102
106
Ok ( ( ) )
103
107
}
104
108
109
+ fn generate_opencv_inherent_feature_cond_macros ( & self ) -> Result < ( ) > {
110
+ static COND_MACRO_TPL : & str = include_str ! ( "cond_macros/opencv_inherent_feature.rs" ) ;
111
+
112
+ let mut cond_macros_file = BufWriter :: new ( File :: options ( ) . append ( true ) . open ( OUT_DIR . join ( "opencv/cond_macros.rs" ) ) ?) ;
113
+ for inherent_feature in SUPPORTED_INHERENT_FEATURES {
114
+ write_replace (
115
+ COND_MACRO_TPL ,
116
+ "OPENCV_INHERENT_FEATURE" ,
117
+ inherent_feature,
118
+ & mut cond_macros_file,
119
+ ) ?;
120
+ }
121
+ Ok ( ( ) )
122
+ }
123
+
105
124
fn run ( & self , opencv_header_dir : & Path , opencv : & Library ) -> Result < ( ) > {
106
125
let additional_include_dirs = opencv
107
126
. include_paths
0 commit comments