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

Support for custom vcpkg triplets #44

Open
nico-abram opened this issue Dec 20, 2021 · 2 comments
Open

Support for custom vcpkg triplets #44

nico-abram opened this issue Dec 20, 2021 · 2 comments

Comments

@nico-abram
Copy link

I'm using some dependencies which use this crate to link C/C++ libraries on windows (For example leptonica and tesseract).

I am trying to enable cross-language LTO on a build targeting x86_64-pc-windows-msvc. This requires compiling C/C++ code using an LLVM compiler, which means not using MSVC's cl.exe compiler. I have gotten it to compile using clang-cl instead of MSVC's cl.exe and lld-link.exe instead of link.exe manually building the C/C++ code and instructing my dependencies via env vars to not use this crate and instead use the libs I generated, but I think ideally vcpkg can be made to work with it.

I found this issue microsoft/vcpkg#2087 about clang-cl support in vcpkg, which was closed and vcpkg does not support a triplet for it, not as an official triplet, nor as a community maintained triplet shipped with vcpkg. However, vcpkg has support for "custom triplets" which are even less supported than community and you have to manually add to the vcpkg/triplets folder. And in that issue, someone shared their github repository with custom triplets which includes a x64-windows-llvm triplet that uses clang-cl. I'm opening this issue to check/discuss if somehow (Maybe through an environment variable) custom vcpkg triplet support would be in scope for this crate.

I am essentially thinking of something like:

REM I manually make a triplet file for vcpkg and add it to vcpkg/triplets before installing libs and then run this
set VCPKGRS_TRIPLET_OVERRIDE=x64-windows-llvm-thinlto
cargo build --release
@ras0219-msft
Copy link

ras0219-msft commented Feb 11, 2022

vcpkg itself has an environment variable to inject overlay triplet paths: https://github.com/microsoft/vcpkg/blob/master/docs/users/config-environment.md#vcpkg_overlay_triplets.

Have you tried using that in combination with VCPKGRS_TRIPLET_OVERRIDE?

@nico-abram
Copy link
Author

VCPKGRS_TRIPLET_OVERRIDE does not exist, it was hypothetical

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

No branches or pull requests

2 participants