Add cfg settings for enabled modules...
...so that you can conditionally compile with, say, #[cfg(mod_dnn)].
MODIFY
build.rs
build.rs
@@ -699,6 +699,10 @@ fn make_modules(opencv_dir_as_string: &str) -> Result<()> {
})
.collect();
+ for m in &modules {
+ println!("cargo:rustc-cfg=mod_{}", m);
+ }
+
MODULES.set(modules).expect("Can't set MODULES cache");
Ok(())
}

Add cfg settings for enabled modules...

...so that you can conditionally compile with, say, #[cfg(mod_dnn)].