Replies: 1 comment 5 replies
-
I am having the same problem. Using using vcpkg with Ninja Multi-Config. Is nobody else having this issue? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a cmake project that targets both windows and linux. For the windows build, I'm specifying the v142 platform toolset using VCPKG_TARGET_TRIPLET, with a custom triplet that specifies the appropriate VCPKG_PLATFORM_TOOLSET, because the users of my library are still building with VS2019 and v142 toolset.
This is my custom triplet:
It's getting passed to vcpkg via cmake by setting the VCPKG_TARGET_TRIPLET cache variable equal to the name of my custom triplet. (yes, I deleted the cmake cache and ran configure before building again).
Everything in my project builds fine, and vcpkg output shows that it's using my triplet. When attempting to link my static library into the application using it, it works for Debug builds; but release builds are failing with the following error:
I'm not explicitly setting this flag, but according to this documentation it's auto-enabled in the latest toolset versions when using permissive- (which I am using). This particular linker flag is only supported in VS2022, version 17.4 or later (v143 toolset). So I can only conclude that somehow my library is getting built with the wrong toolset.
Any thoughts on how to troubleshoot/fix this? I've tried passing --debug to vcpkg to troubleshoot, but when I look in vcpkg-manifest-install.log I don't see anything that would indicate what's going on. The v143 toolset only shows up in the logfile in relation to the host triplet vcpkg uses for compiler detection stuff. When building targets it appears to be using my custom triplet. I even tried specifying my custom triplet for the VCPKG_HOST_TRIPLET var, but that didn't seem to make any difference in the error I'm getting (although it did remove the reference to v143 toolset that was showing up in the log).
Beta Was this translation helpful? Give feedback.
All reactions