Bewerken

Delen via


Common command options

Most vcpkg commands accept a group of common options that control cross-cutting aspects of the tool. Not all options affect every command. For example, a command that does not download any files will be unaffected by changing the downloads directory.

Options

--x-asset-sources=<config>

Note

This section covers an experimental feature of vcpkg which may change or be removed at any time.

Specify the cache configuration for Asset Caching.

--binarysource=<config>

Add a source for Binary Caching.

This option can be specified multiple times; see the Binary Caching documentation for how multiple binary sources interact.

--x-buildtrees-root=<path>

Note

This section covers an experimental feature of vcpkg which may change or be removed at any time.

Specifies the temporary path to store intermediate build files, such as objects or unpacked source code.

Defaults to buildtrees/ under the vcpkg root folder.

--x-cmake-configure-debug=<debugger-pipe>[;semicolon;port;list]

Note

This section covers an experimental feature of vcpkg which may change or be removed at any time.

Enables CMake's --debugger within upstream build systems' CMakeLists.txt, such as within vcpkg_cmake_configure.

The <debugger-pipe> value is passed as --debugger-pipe on the CMake command line.

If there is a semicolon-separated port list, the debugger is only used for ports in that list. Otherwise, it is used for all ports.

The triplet variable VCPKG_CMAKE_CONFIGURE_OPTIONS is used to pass the options to the internal CMake configure call. As such it will not work for custom triplets overwriting VCPKG_CMAKE_CONFIGURE_OPTIONS. Either manually pass the debugging options or append your options to VCPKG_CMAKE_CONFIGURE_OPTIONS instead.

Unlike --x-cmake-debug there will be no output indicating that the build is waiting for a debugger to connect. The output will simply stall at Configuring <triplet>.

Although all ports should be calling CMake inside of the portfile to obtain compile flags from the CMake toolchain. This command is mainly useful for ports actually using CMake as their build system.

--x-cmake-debug=<debugger-pipe>[;semicolon;port;list]

Note

This section covers an experimental feature of vcpkg which may change or be removed at any time.

Enables CMake's --debugger while running directly-invoked CMake scripts like triplet files (for example: x64-windows.cmake) or portfile.cmake files.

The <debugger-pipe> value is passed as --debugger-pipe on the CMake command line.

If there is a semicolon-separated port list, the debugger is only used for ports in that list. Otherwise, it is used for all ports.

Note: The debugger can be attached if Waiting for debugger client to connect... can be observed in the output of vcpkg and execution is halted until a debugger is connected.

--downloads-root=<path>

Specify where downloaded tools and source code archives should be kept.

Defaults to the VCPKG_DOWNLOADS environment variable. If that is unset, defaults to downloads/ under the vcpkg root folder.

--feature-flags=<flag1>,...

This variable can be set to a list of feature flags to opt-in to experimental behavior.

--host-triplet=<triplet>

Specify the host triplet.

Defaults to the VCPKG_DEFAULT_HOST_TRIPLET environment variable. If that is also unset, the value is deduced based on the host architecture and operating system.

--x-install-root=<path>

Note

This section covers an experimental feature of vcpkg which may change or be removed at any time.

Specifies the path to lay out installed packages.

In Classic mode, defaults to installed/ under the vcpkg root folder.

In Manifest mode, defaults to vcpkg_installed/ under the manifest folder.

--x-manifest-root=<path>

Note

This section covers an experimental feature of vcpkg which may change or be removed at any time.

Specifies the directory containing vcpkg.json.

Defaults to searching upwards from the current working directory for the nearest vcpkg.json.

--overlay-ports=<path>

Specifies a directory containing overlay ports.

This option can be specified multiple times; ports will resolve to the first match.

--overlay-triplets=<path>

Specifies a directory containing overlay triplets.

This option can be specified multiple times to add multiple directories; triplets will resolve to the first match by name.

--x-packages-root=<path>

Note

This section covers an experimental feature of vcpkg which may change or be removed at any time.

Specifies the temporary path to stage intermediate package files before final install.

Defaults to packages/ under the vcpkg root folder.

--triplet=<triplet>

Specify the target architecture triplet.

Defaults to the VCPKG_DEFAULT_TRIPLET environment variable. If that is unset, deduced based on the host architecture and operating system.

On Windows operating systems, the architecture is always deduced as x86 for legacy reasons.

Note

All releases made in and after September 2023 will default to the host triplet on Windows instead of x86-windows.

--vcpkg-root=<path>

Specifies the vcpkg root folder.

Defaults to the directory containing the vcpkg program. The directory must be a valid vcpkg instance, such as a git clone of https://github.com/microsoft/vcpkg. This option can be used to run a custom-built copy of the tool directly from the build folder.

Response Files (@<file>)

The vcpkg command line accepts text files containing newline-separated command line parameters.

The tool will act as though the items in the file were spliced into the command line in place of the @ reference. Response files cannot contain additional response files.