Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions docs/users/config-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,14 @@ This environment variable changes the metadata of produced NuGet packages. See [
#### VCPKG_USE_NUGET_CACHE

This environment variable allows using NuGet's cache for every nuget-based binary source. See [Binary Caching](binarycaching.md#NuGets-cache) for more details.

#### VCPKG_BUILD_TYPE

This environment variable allows to select a single build type configuration.
This allows to reduce build times and disk storage requirements locally or in
continuous integration setups.
The environment variable overrides settings in triplet files.
Note that some ports do not support single build type configurations.

At the moment, the only supported value is: `release`.

3 changes: 3 additions & 0 deletions scripts/ports.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ if(CMD MATCHES "^BUILD$")
include("${SCRIPTS}/cmake/z_vcpkg_apply_patches.cmake")
include("${SCRIPTS}/cmake/z_vcpkg_prettify_command_line.cmake")

include("${SCRIPTS}/vcpkg_get_tags.cmake")
z_vcpkg_select_build_type()

include("${CURRENT_PORT_DIR}/portfile.cmake")
if(DEFINED PORT)
include("${SCRIPTS}/build_info.cmake")
Expand Down
14 changes: 14 additions & 0 deletions scripts/vcpkg_get_tags.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
macro(z_vcpkg_select_build_type)
if(DEFINED ENV{VCPKG_BUILD_TYPE})
if(NOT "$ENV{VCPKG_BUILD_TYPE}" STREQUAL "release")
# Cf. https://github.com/microsoft/vcpkg/pull/16110
message(FATAL_ERROR "The only supported value for VCPKG_BUILD_TYPE is 'release'.")
endif()
set(VCPKG_BUILD_TYPE "$ENV{VCPKG_BUILD_TYPE}")
if(NOT "VCPKG_BUILD_TYPE" IN_LIST VCPKG_ENV_PASSTHROUGH)
# This is for tracking, not for usage by ports.
list(APPEND VCPKG_ENV_PASSTHROUGH "VCPKG_BUILD_TYPE")
endif()
endif()
endmacro()
function(vcpkg_get_tags PORT FEATURES VCPKG_TRIPLET_ID VCPKG_ABI_SETTINGS_FILE)
z_vcpkg_select_build_type()
message("d8187afd-ea4a-4fc3-9aa4-a6782e1ed9af")
vcpkg_triplet_file(${VCPKG_TRIPLET_ID})

Expand Down