You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3rd party vendor provides a pre-compiled shared object and header only (used via cc_library + cc_import)
generating rust constants from a header file without any code to link to
Ideally rust_bindgen should just be a code generator that does not impose any additional requirements not needed by bindgen itself, or a separate un-opinionated interoperable code generation rule should be provided.
The text was updated successfully, but these errors were encountered:
neilisaac
changed the title
rust_bindgen should not require compile_data
rust_bindgen should not require a static library
Jun 18, 2024
I worked around this by generating an empty .cc file and creating a dummy cc_library target that depends on it + the headers, which is passed to cc_lib, then I wrap rust_bindgen with a rust_library that adds the real shared object to deps.
rust_bindgen
currently asserts that the cc_lib has an associated static library to link: https://github.com/bazelbuild/rules_rust/blob/main/bindgen/private/bindgen.bzl#L140. This is problematic for use cases where this cannot be satisfied.Example use cases:
Ideally rust_bindgen should just be a code generator that does not impose any additional requirements not needed by bindgen itself, or a separate un-opinionated interoperable code generation rule should be provided.
The text was updated successfully, but these errors were encountered: