corrosion-rs / corrosion

Marrying Rust and CMake - Easy Rust and C/C++ Integration!
https://corrosion-rs.github.io/corrosion/
MIT License
1.02k stars 97 forks source link

[Enhancement]: Vcpkg support #482

Closed bconn98 closed 4 months ago

bconn98 commented 5 months ago

Current Behavior

Corrosion supports installation via submodule or FetchContent.

Expected Behavior

Vcpkg by default disables FetchContent, while it can be forced to allow it to work, it would be beneficial to provide a port for installing via Vcpkg. The added support is minimal as you already provide installation rules. It is 2 files that are added to the Microsoft vcpkg repo with small updates following a new release.

Steps To Reproduce

No response

Environment

- OS:
- CMake:
- CMake Generator:

CMake configure log with Debug log-level

No response

CMake Build step log

No response

jschwe commented 5 months ago

I'm not familiar with vcpkg and currently don't have much free capacity. Corrosion is also available via homebrew, which is maintained by the community and not by me or any of the other maintainers directly. If someone contributed vcpkg support, I would gladly add it to corrosions documentation.

bconn98 commented 5 months ago

Cool, I can throw it together at some point this week. Do you know when the cmake install rules for the tool were added? I can add backwards compatibility support through that point. I know my use case is on v0.4.5 but I can take it back farther.

jschwe commented 5 months ago

The install rules have been there from the beginning - at the very least starting from Corrosion 0.2. It probably doesn't make much sense to add anything before v0.4 though, since I think v0.3 and before will not work properly on windows with the most recent Rust versions. Corrosion also follows semver, so I'm not sure sure if there is much value adding v0.4 versions before the latest version (v0.4.7) since there shouldn't be any breaking changes.

jschwe commented 4 months ago

The upstream vcpkg PR has apparently been rejected, so I'll be closing this issue. Just to be clear, from my side I don't object adding corrosion to vcpkg, but I don't see any point in keeping this issue when upstream has rejected the proposal.

bconn98 commented 4 months ago

Agreed, the PR we applied a few weeks ago covers ensures compatibility with Vcpkg so I should be all set.