Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the cargo-c metadata #812

Merged
merged 1 commit into from
Sep 3, 2024
Merged

Add the cargo-c metadata #812

merged 1 commit into from
Sep 3, 2024

Conversation

lu-zero
Copy link
Contributor

@lu-zero lu-zero commented Sep 1, 2024

Fixes #592

The default cargo cinstall --destdir some/path produces on macos:

└── usr
    └── local
        ├── include
        │   └── resvg
        │       └── resvg.h
        └── lib
            ├── libresvg.0.43.0.dylib
            ├── libresvg.0.43.dylib -> libresvg.0.43.0.dylib
            ├── libresvg.a
            ├── libresvg.dylib -> libresvg.0.43.0.dylib
            └── pkgconfig
                └── resvg.pc

@RazrFalcon
Copy link
Collaborator

Can you elaborate what cinstall is and how it should be used?

@lu-zero
Copy link
Contributor Author

lu-zero commented Sep 2, 2024

It is part of cargo-c, it builds and install the C-API crate as a normal C-library (both static and shared) including the pkg-config file.

It uses the metadata I added to Cargo.toml to find the crate(s) that should be made libraries and optionally generates the C header or install pre-made ones.

@RazrFalcon
Copy link
Collaborator

Can you add a note about it to crates/c-api/README.md? So people would know how to use it.
I don't want to add a random stuff to Cargo.toml. Since it will only confuse people.

@lu-zero
Copy link
Contributor Author

lu-zero commented Sep 2, 2024

Here an update with another commit to convert the example to use the uninstalled pkg-config.

@RazrFalcon
Copy link
Collaborator

This time it's too much. Most people should still use just a regular cargo build.
Let's keep just the Cargo.toml changes. I will update the readme later.

@RazrFalcon RazrFalcon merged commit c0777c7 into linebender:master Sep 3, 2024
4 of 6 checks passed
@RazrFalcon
Copy link
Collaborator

Thanks.

@lu-zero lu-zero deleted the cargo-c branch September 3, 2024 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide pkg-config file with the C library
2 participants