-
I want to build a library which also depends on other libraries using vcpkg manifest mode inside a custom registry. example manifest:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I finally came to a sort of hackish workaround like this at the beginning of my cmake lists file, before any project statement: if(WIN32)
SET(VCPKG_TARGET_TRIPLET "x64-windows-static")
elseif(UNIX)
SET(VCPKG_TARGET_TRIPLET "x64-linux")
else()
message("==================================================================")
message("Unsupported platform: neither Windows or Linux")
message("==================================================================")
message(FATAL_ERROR )
endif()
SET(BUILD_SHARED_LIBS OFF)
set(VCPKG_CRT_LINKAGE dynamic) Any suggestions how to improve this? I doubt it's the way how things should be done. Is it? |
Beta Was this translation helpful? Give feedback.
-
It's not possible to set linkage in manifest file. You should pass
See |
Beta Was this translation helpful? Give feedback.
It's not possible to set linkage in manifest file. You should pass
VCPKG_TARGET_TRIPLET
to cmake (for example, viaCMakePresets.json
).If you want only certain libraries to be static, you should create an overlay-triplet and make a condition on packages you want to be static.
x64-windows-mixed.cmake
:See
https://github.com/microsoft/vcpkg/blob/master/docs/users/triplets.md#per-port-customization
https://github.com/microsoft/vcpkg/blob/master/docs/examples/overlay-triplets-linux-dynamic.md