TExcelTAD

Triplets

A triplet is vcpkg's name for a target configuration, a small CMake file that sets variables. Its name is usually <arch>-<os>[-<variant>]: x64-linux, arm64-osx, x64-windows-static. Where Conan describes a configuration with a profile of independent settings, vcpkg bundles it into one named triplet.

What a triplet contains

bash · try it yourself
cd "$VCPKG_ROOT/triplets"
ls *.cmake
echo "--- x64-linux.cmake"
cat x64-linux.cmake
echo "--- community triplets: $(ls community | wc -l), for example"
ls community | grep -E '^(x64-linux|arm64-linux|x64-mingw)' 
arm-neon-android.cmake
arm64-android.cmake
arm64-linux.cmake
arm64-osx.cmake
arm64-windows-static-md.cmake
arm64-windows.cmake
x64-android.cmake
x64-linux.cmake
x64-windows-release.cmake
x64-windows-static-md.cmake
x64-windows-static.cmake
x64-windows.cmake
x86-windows.cmake
--- x64-linux.cmake
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)

set(VCPKG_CMAKE_SYSTEM_NAME Linux)

--- community triplets: 91, for example
arm64-linux-dynamic.cmake
arm64-linux-release.cmake
x64-linux-dynamic.cmake
x64-linux-release.cmake
x64-mingw-dynamic-release.cmake
x64-mingw-dynamic.cmake
x64-mingw-static-release.cmake
x64-mingw-static.cmake
Variable Meaning
VCPKG_TARGET_ARCHITECTURE x86, x64, arm, arm64, wasm32, …
VCPKG_CMAKE_SYSTEM_NAME empty for Windows desktop; Linux, Darwin, Android, WindowsStore, Emscripten, …
VCPKG_CRT_LINKAGE C runtime: dynamic or static (on Windows: /MD vs /MT)
VCPKG_LIBRARY_LINKAGE build libraries as static or dynamic
VCPKG_BUILD_TYPE empty = Debug and Release; release = Release only (faster CI)
VCPKG_CXX_FLAGS, VCPKG_C_FLAGS, VCPKG_LINKER_FLAGS extra flags for every port
VCPKG_CHAINLOAD_TOOLCHAIN_FILE a CMake toolchain for cross-compiling
VCPKG_OSX_ARCHITECTURES, VCPKG_OSX_DEPLOYMENT_TARGET macOS specifics

x64-linux builds static libraries against the dynamic C runtime, in both Debug and Release.

The triplets you'll meet

Triplet Libraries Runtime Notes
x64-windows DLLs dynamic (/MD) Windows default for x64
x64-windows-static static static (/MT) fully static executables
x64-windows-static-md static dynamic (/MD) static libraries that match the default MSVC runtime
x64-linux static dynamic Linux default
x64-linux-dynamic (community) shared .so dynamic
arm64-osx / x64-osx static dynamic Apple Silicon / Intel Macs
arm64-android, wasm32-emscripten static cross targets

Built-in triplets (in triplets/) are tested by vcpkg's CI; community triplets (in triplets/community/) are maintained on a best-effort basis.

Choosing a triplet

The target triplet comes from, in order: --triplet on the command line, VCPKG_TARGET_TRIPLET in CMake, the VCPKG_DEFAULT_TRIPLET environment variable, or the host detection. The host triplet (--host-triplet, VCPKG_HOST_TRIPLET) is used for tools that must run during the build, such as protoc; it's what "host": true dependencies are built for.

Custom triplets

When no triplet fits, write one and point vcpkg at the folder with --overlay-triplets (or VCPKG_OVERLAY_TRIPLETS, or "overlay-triplets" in vcpkg-configuration.json). A common one is "Linux, Release only, with -fPIC", to halve CI build times:

bash · try it yourself
mkdir -p app/triplets && cd app
cat > triplets/x64-linux-rel-pic.cmake <<'TXT'
set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
set(VCPKG_BUILD_TYPE release)
set(VCPKG_CXX_FLAGS "-fPIC")
set(VCPKG_C_FLAGS "-fPIC")
TXT
cat > vcpkg.json <<'JSON'
{ "builtin-baseline": "5d4a3dc90c0b3773f3bac81bf41297b54328f471", "dependencies": [ "fmt" ] }
JSON
vcpkg install --overlay-triplets=triplets --triplet=x64-linux-rel-pic 2>&1 \
  | grep -E 'will be built|^ +[*]? *[a-z-]+:x64|overlay triplet|Restored|Downloading|error:' | head -12
The following packages will be built and installed:
    fmt:x64-linux-rel-pic@12.2.0#1
  * vcpkg-cmake:x64-linux@2025-08-07
  * vcpkg-cmake-config:x64-linux@2026-07-21
Restored 2 package(s) from /opt/vcpkg-cache in 3.81 ms. Use --debug to see more details.
/home/learner/app/triplets/x64-linux-rel-pic.cmake: info: loaded overlay triplet from here
Downloading https://github.com/fmtlib/fmt/archive/12.2.0.tar.gz -> fmtlib-fmt-12.2.0.tar.gz
error: curl operation failed with error code 6 (Couldn't resolve host name).
error: Not a transient network error, won't retry download from https://github.com/fmtlib/fmt/archive/12.2.0.tar.gz
error: building fmt:x64-linux-rel-pic failed with: BUILD_FAILED

vcpkg accepted the overlay triplet (loaded overlay triplet from here) and started building. The container's binary cache has packages only for x64-linux, and a new triplet means a new ABI hash, so the host tools were restored but fmt had to be built from source, and the source download failed offline. Two lessons: every distinct triplet is a separate set of binaries to build and cache, and the host tools (vcpkg-cmake, built for the host triplet x64-linux) were still found because only the target triplet changed.

Test yourself

What does x64-windows-static-md build?

  1. DLLs with the static runtime
  2. Static libraries using the dynamic C runtime (/MD)
  3. Static libraries with the static runtime (/MT)
  4. Debug-only libraries

Which triplet variable makes vcpkg skip Debug builds?

  1. VCPKG_CRT_LINKAGE
  2. VCPKG_BUILD_TYPE release
  3. VCPKG_LIBRARY_LINKAGE
  4. VCPKG_TARGET_ARCHITECTURE

Why did fmt need a source build with the custom triplet, although x64-linux binaries were cached?

  1. The overlay was ignored
  2. A different triplet changes the ABI hash, so the cached x64-linux package doesn't match
  3. fmt doesn't support Linux
  4. Overlay triplets disable caching