Skip to content

Parse the native staticlib dependencies output from rustc #335

@jschwe

Description

@jschwe

Currently, corrosion hardcodes the libraries required by Rust static libs (OS-dependent).
This list may not be always up-to-date and cover all required libraries, since the exact list may change between different rust versions, and additional libraries may be added by #[link] attributes in user code or from build scripts!
Getting this information requires actually building the crate (with --print=native-static-libs) and all its dependencies.

Probably the only way to pass these dependencies from the rustc output at build-time to the CMake linker command line would be by saving the required arguments to a response file, which clang/gcc support loading via @file. I think MSVC also has such an option.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions