From a2b932594843e3df8d7fa48fa016c7cf0ed929b6 Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Mon, 25 Jun 2018 22:14:07 -0700 Subject: [PATCH] [docs-triplets] Improve triplet documentation --- docs/users/triplets.md | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/docs/users/triplets.md b/docs/users/triplets.md index 7aea35dd20..70580df46f 100644 --- a/docs/users/triplets.md +++ b/docs/users/triplets.md @@ -12,10 +12,10 @@ To change the triplet used by your project, such as to enable static linking, se ### VCPKG_TARGET_ARCHITECTURE Specifies the target machine architecture. -Valid options are `x86`, `x64`, and `arm`. +Valid options are `x86`, `x64`, `arm`, and `arm64`. ### VCPKG_CRT_LINKAGE -Specifies the desired MSVCRT linkage. +Specifies the desired CRT linkage (for MSVC). Valid options are `dynamic` and `static`. @@ -27,8 +27,11 @@ Valid options are `dynamic` and `static`. Note that libraries can ignore this se ### VCPKG_CMAKE_SYSTEM_NAME Specifies the target platform. -Valid options are `WindowsStore` or empty. Empty corresponds to Windows Desktop and `WindowsStore` corresponds to UWP. -When setting this variable to `WindowsStore`, you must also set `VCPKG_CMAKE_SYSTEM_VERSION` to `10.0`. +Valid options include any CMake system name, such as: +- Empty (Windows Desktop for legacy reasons) +- `WindowsStore` (Universal Windows Platform) +- `Darwin` (Mac OSX) +- `Linux` (Linux) ### VCPKG_PLATFORM_TOOLSET Specifies the VS-based C/C++ compiler toolchain to use. @@ -45,22 +48,35 @@ This (if set) will override all other compiler detection logic. By default, a to See also the CMake documentation for toolchain files: https://cmake.org/cmake/help/v3.11/manual/cmake-toolchains.7.html. +### VCPKG_CXX_FLAGS +Sets additional compiler flags to be used when not using `VCPKG_CHAINLOAD_TOOLCHAIN_FILE`. + +This option also has forms for configuration-specific and C flags: +- `VCPKG_CXX_FLAGS_DEBUG` +- `VCPKG_CXX_FLAGS_RELEASE` +- `VCPKG_C_FLAGS` +- `VCPKG_C_FLAGS_DEBUG` +- `VCPKG_C_FLAGS_RELEASE` + ## Per-port customization The CMake Macro `PORT` will be set when interpreting the triplet file and can be used to change settings (such as `VCPKG_LIBRARY_LINKAGE`) on a per-port basis. Example: ```cmake set(VCPKG_LIBRARY_LINKAGE static) -set(VCPKG_CRT_LINKAGE dynamic) if(PORT MATCHES "qt5-") set(VCPKG_LIBRARY_LINKAGE dynamic) endif() ``` -This will build all the `qt5-*` libraries as DLLs against the dynamic CRT, but every other library as a static library (still against the dynamic CRT). +This will build all the `qt5-*` libraries as DLLs, but every other library as a static library. For an example in a real project, see https://github.com/Intelight/vcpkg/blob/master/triplets/x86-windows-mixed.cmake. ## Additional Remarks -The default triplet when running any vcpkg command is `%VCPKG_DEFAULT_TRIPLET%` or `x86-windows` if that environment variable is undefined. +The default triplet when running any vcpkg command is `%VCPKG_DEFAULT_TRIPLET%` or a platform-specific choice if that environment variable is undefined. + +- Windows: `x86-windows` +- Linux: `x64-linux` +- OSX: `x64-osx` We recommend using a systematic naming scheme when creating new triplets. The Android toolchain naming scheme is a good source of inspiration: https://developer.android.com/ndk/guides/standalone_toolchain.html.