Replies: 5 comments 14 replies
-
You cannot mix triplets! You cannot select triplets by setting To use a custom combination of static/dynamic libraries you need to write your own triplet (provided via overlay triplets) and apply per port customization |
Beta Was this translation helpful? Give feedback.
-
I have a variant on this issue. I have a large project but it boils down to the following. In one project I want to use the static version of a vckpg package in my case pugixml so Note both projects are completely independent and we have good reasons to want to do this. At present we don't use vcpkg for situations like this because of the design decisions that seem to make this impossible, which is a great shame. |
Beta Was this translation helpful? Give feedback.
-
How can I do static and dynamic same time in vcpkg.json?? |
Beta Was this translation helpful? Give feedback.
-
This is possibly the biggest design flaw with vcpkg ever. Not being able to do this (mix dynamic and static libraries provided by it), simply, without the need for the huge pain of custom triplets, make the entire thing feel poorly designed. That, along with no ability to easily specify which version of things you want to use. Is this hard set, or are these shortcomings going to be resolved at some point in the future? I REALLY want to like vcpkg, but honestly, it still seems to be quite a mess still. It only works for me in the simplest of cases. As soon as I want to use it on a reasonably sized project, I have to go elsewhere. |
Beta Was this translation helpful? Give feedback.
-
I have a (somewhat) different case, which I think, I cannot resolve at all because of this limitation: I have a custom port for a dependency not managed by vcpkg. This port can provide dynamic libraries only. Thus, I've added The problem now is, that this port has a dependency to OpenSSL, which it requires to be provided as dynamic library. As far as I've understood, the triplets only work on "project" level, not on port level, right? Thus, the users of that port need to know this limitation and have to create a custom triplet, which ensures that OpenSSL is always built dynamic, right? This is bad, especially, because this prevents them from statically linking OpenSSL for the rest of the project (which works perfectly well).. Have I missed something? Is it possible to somehow declare the dependency dynamic library to be dynamic as well without affecting the overall project? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I am very confused as I can't seem to find a way to add both static and dynamic libraries to my cmake project?
I've tried using the
set(VCPKG_TARGET_TRIPLET "x86-windows-static")
command before Ifind_package
the libraries I want to use, but this command seems to be sometimes useful and sometimes useless (so I'm not sure if it's the only or the correct way for me to specify static or dynamic libraries) way).In my tests, I have both the
x86-windows
andx86-windows-static
versions ofopenssl
andboost-locale
, and when I use theBut when I want to use the

x86-windows-static
version ofopenssl
, everything works fine and mycmake
correctly recognizes thex86-windows-static
version ofopenssl
But when trying to use the
static
version ofboost-locale
, everything sucks because it recognizes the dynamic library version instead of the static version I want!So I'm asking if there is a way to add both dynamic libraries (not shown in the test because I only want to statically link
boost-locale
) and static libraries incmake
?Beta Was this translation helpful? Give feedback.
All reactions