mcgoo / vcpkg-rs

Build library for finding native libraries in vcpkg for Rust - Windows (msvc), Linux and macOS
https://docs.rs/vcpkg
Apache License 2.0
108 stars 22 forks source link

Support custom triplet #20

Closed Perlmint closed 3 years ago

Perlmint commented 4 years ago

If triplet is not specified, use an inferred triplet.

Perlmint commented 3 years ago

Rebased onto latest master & fix compile error on 1.10

Closing the PR was triggered by mistake about rebasing.

mcgoo commented 3 years ago

Thanks for making this - it looks like a useful feature. Sorry I have taken so long to get to responding to you about it.

My main reservation with it is that all crates that use vcpkg to find components within a given build need to use the same configuration, otherwise it is possible to end up with two differently built copies of a dependency which will conflict with each other.

The only way that I can see to have settings global to a build is by using environment variables. I'd like to add an environment based configuration variable for the triplet at the same time as this PR. (You are welcome to add the ability to set a custom triplet using an environment variable if you would like, otherwise I should get to it shortly. I'd use VCPKGRS_TRIPLET. Any interest in adding that?)

Out of interest, do you use a custom vcpkg triplet in the application you are building, or are you using the default arm64-ios?

Perlmint commented 3 years ago

Using the environment variable looks good. I'll add a new commit to this PR soon. 😄

Actually, My project is using my own custom arm64-linux triplet. I can't remember the exact reason why I choose arm64-ios. I thought it could be commonly used among the community triplets. 😅

mcgoo commented 3 years ago

Fantastic, thanks!