Skip to content

Working with CMake project that uses cargo #189

Open
@mschuckmann

Description

@mschuckmann

I'm working on creating a recipe that builds a C interop library for a rust based project zenoh-c.

The recommended method for building and installing the library is to use CMake which uses cargo to build the .so file and then uses standard CMake idioms to install the library, headers, pkgconfig, and CMake configuration files.

It seems that I can use cargo_bin to build the .so file without much problem but I'm at a bit of a loss on how to make the CMake specific stuff work. I also tried using snippets of code from cargo_bin.bbclass in my recipe to configure the environment to allow CMake to drive the cargo build for the target but it's not quite working like I'd expect.

I'm wondering if anyone can make any recommendations the best way to go here.

I'm also wondering if maybe the code in cargo_bin.bbclass that configures the environment, scripts, etc can be broken out into a separate class that recipes that don't want to call cargo build directly can use. The cargo_bin.bbclass would obviously use this new class.

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