Skip to content

build.rs should be able to output executable c/c++ binary via cc-rs #458

Closed
@furoraest

Description

@furoraest

I created project, where we added some c++ bindings to rust.
I ended up compiling c++ files by hand, even though everything was pretty easily manageable via build.rs
Only thing what was missing was outputting from build.rs the real c++ binary (not the library)
I know, that using little main.rs magic, its easily doable but in this case, rust is plug-in to the the c++, not vise versa, so adding main.rs just to "call out binary" seems excessive.
I would like to see that all the different scenarios can be managed from build.rs (generating libraries, binaries for different platforms, from different languages c/c++/rust) -
that would really boost the already powerful cargo build and deprecates need of different build scripts.
Is it possible to compile the c++ as binary with cc-rs via build.rs? If not please consider to add it.

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