Skip to content

How to propagate #[cfg(ocvrs_has_module_xxx)] to user crates #670

Open
@OlivierLDff

Description

@OlivierLDff

Hi I'm not sure if this is a general rust question, or something related specifically to this build.rs.

I see that modules are generated based on what the found opencv library what compiled with. So if let's say sfm is disabled, no function for the opencv::sfm modules will exists.

How to get access to that in my crate so I can do some fallback if the function wasn't generated on avoid build failure?

From my small understanding:

  • cfg can be defined by a build.rs, but then I would have to reimplement all of the Library::probe() logic.
  • How can I consume the library used in the build script of this repo?

An alternative would be to use features flags, but I would like to keep that as last resort.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions