From fe2a6bb789e904520797ec229272c6c1a42e7e38 Mon Sep 17 00:00:00 2001 From: nicole mazzuca Date: Wed, 10 Mar 2021 15:33:16 -0800 Subject: [host dependencies] add support in the scripts (#16627) This contains all the docs and scripts changes from #16479, without any of the ports changes, for easier CR --- scripts/buildsystems/msbuild/vcpkg-general.xml | 3 +++ scripts/buildsystems/msbuild/vcpkg.targets | 14 +++++++++----- scripts/buildsystems/vcpkg.cmake | 5 +++++ scripts/cmake/vcpkg_common_definitions.cmake | 4 ++++ scripts/ports.cmake | 3 +++ scripts/vcpkg.schema.json | 19 +++++++++++-------- 6 files changed, 35 insertions(+), 13 deletions(-) (limited to 'scripts') diff --git a/scripts/buildsystems/msbuild/vcpkg-general.xml b/scripts/buildsystems/msbuild/vcpkg-general.xml index 49865e74e..5c84aa0da 100644 --- a/scripts/buildsystems/msbuild/vcpkg-general.xml +++ b/scripts/buildsystems/msbuild/vcpkg-general.xml @@ -65,6 +65,9 @@ + + diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 074d35d90..b99011324 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -30,6 +30,10 @@ debug\ true + + <_ZVcpkgHostTripletParameter Condition="'$(VcpkgHostTriplet)' != ''">"--host-triplet=$(VcpkgHostTriplet)" + <_ZVcpkgExecutable>$([System.IO.Path]::Combine($(VcpkgRoot), 'vcpkg.exe')) + VcpkgTriplet=$(VcpkgTriplet):$(ProjectStateLine) @@ -77,7 +81,7 @@ + Outputs="$(TLogLocation)VcpkgInstallManifest$(VcpkgTriplet).read.1u.tlog;$(VcpkgInstalledDir).msbuildstamp-$(VcpkgTriplet).$(VcpkgHostTriplet).stamp"> @@ -85,15 +89,15 @@ <_VcpkgItemToDelete Include="$(VcpkgInstalledDir).msbuildstamp-*" /> - - - - + diff --git a/scripts/buildsystems/vcpkg.cmake b/scripts/buildsystems/vcpkg.cmake index c830644e9..9bdf6573e 100644 --- a/scripts/buildsystems/vcpkg.cmake +++ b/scripts/buildsystems/vcpkg.cmake @@ -578,6 +578,11 @@ if(VCPKG_MANIFEST_MODE AND VCPKG_MANIFEST_INSTALL AND NOT Z_VCPKG_CMAKE_IN_TRY_C message(STATUS "Running vcpkg install") set(Z_VCPKG_ADDITIONAL_MANIFEST_PARAMS) + + if(DEFINED VCPKG_HOST_TRIPLET AND NOT VCPKG_HOST_TRIPLET STREQUAL "") + list(APPEND Z_VCPKG_ADDITIONAL_MANIFEST_PARAMS "--host-triplet=${VCPKG_HOST_TRIPLET}") + endif() + if(VCPKG_OVERLAY_PORTS) foreach(Z_VCPKG_OVERLAY_PORT IN LISTS VCPKG_OVERLAY_PORTS) list(APPEND Z_VCPKG_ADDITIONAL_MANIFEST_PARAMS "--overlay-ports=${Z_VCPKG_OVERLAY_PORT}") diff --git a/scripts/cmake/vcpkg_common_definitions.cmake b/scripts/cmake/vcpkg_common_definitions.cmake index 897d30832..b505f3693 100644 --- a/scripts/cmake/vcpkg_common_definitions.cmake +++ b/scripts/cmake/vcpkg_common_definitions.cmake @@ -18,6 +18,10 @@ VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX import library suffix for target (same VCPKG_FIND_LIBRARY_PREFIXES target dependent prefixes used for find_library calls in portfiles VCPKG_FIND_LIBRARY_SUFFIXES target dependent suffixes used for find_library calls in portfiles VCPKG_SYSTEM_LIBRARIES list of libraries are provide by the toolchain and are not managed by vcpkg +TARGET_TRIPLET the name of the current triplet to build for +CURRENT_INSTALLED_DIR the absolute path to the installed files for the current triplet +HOST_TRIPLET the name of the triplet corresponding to the host +CURRENT_HOST_INSTALLED_DIR the absolute path to the installed files for the host triplet ``` CMAKE_STATIC_LIBRARY_(PREFIX|SUFFIX), CMAKE_SHARED_LIBRARY_(PREFIX|SUFFIX) and CMAKE_IMPORT_LIBRARY_(PREFIX|SUFFIX) are defined for the target diff --git a/scripts/ports.cmake b/scripts/ports.cmake index 62ee9f6aa..4adb48149 100644 --- a/scripts/ports.cmake +++ b/scripts/ports.cmake @@ -79,6 +79,9 @@ if(CMD MATCHES "^BUILD$") endforeach() endif() + set(HOST_TRIPLET "${_HOST_TRIPLET}") + set(CURRENT_HOST_INSTALLED_DIR "${_VCPKG_INSTALLED_DIR}/${HOST_TRIPLET}" CACHE PATH "Location to install final packages for the host") + set(TRIPLET_SYSTEM_ARCH "${VCPKG_TARGET_ARCHITECTURE}") include("${SCRIPTS}/cmake/vcpkg_common_definitions.cmake") include("${SCRIPTS}/cmake/execute_process.cmake") diff --git a/scripts/vcpkg.schema.json b/scripts/vcpkg.schema.json index c485aa415..215f5dd9c 100644 --- a/scripts/vcpkg.schema.json +++ b/scripts/vcpkg.schema.json @@ -128,6 +128,10 @@ "$ref": "#/definitions/identifier" } }, + "host": { + "type": "boolean", + "default": false + }, "default-features": { "type": "boolean", "default": true @@ -190,9 +194,6 @@ "description": "A package feature that can be activated by consumers.", "type": "object", "properties": { - "name": { - "$ref": "#/definitions/identifier" - }, "description": { "$ref": "#/definitions/description-field" }, @@ -208,7 +209,6 @@ "^\\$": {} }, "required": [ - "name", "description" ], "additionalProperties": false @@ -279,10 +279,13 @@ } }, "features": { - "description": "An array of features supported by the package", - "type": "array", - "items": { - "$ref": "#/definitions/feature" + "description": "An object of features supported by the package", + "type": "object", + "patternProperties": { + "^\\$": {}, + "^[a-z-]+": { + "$ref": "#/definitions/feature" + } } }, "default-features": { -- cgit v1.2.3