diff options
| author | nicole mazzuca <mazzucan@outlook.com> | 2021-03-10 15:33:16 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-10 15:33:16 -0800 |
| commit | fe2a6bb789e904520797ec229272c6c1a42e7e38 (patch) | |
| tree | cedcaf8be3521bf5e3b5ce92f2a8cb496f2615fc /scripts/buildsystems | |
| parent | 6ee0e916d34e45ea0b41b35c3fd8cfb7ce2455e9 (diff) | |
| download | vcpkg-fe2a6bb789e904520797ec229272c6c1a42e7e38.tar.gz vcpkg-fe2a6bb789e904520797ec229272c6c1a42e7e38.zip | |
[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
Diffstat (limited to 'scripts/buildsystems')
| -rw-r--r-- | scripts/buildsystems/msbuild/vcpkg-general.xml | 3 | ||||
| -rw-r--r-- | scripts/buildsystems/msbuild/vcpkg.targets | 14 | ||||
| -rw-r--r-- | scripts/buildsystems/vcpkg.cmake | 5 |
3 files changed, 17 insertions, 5 deletions
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 @@ <StringProperty Name="VcpkgTriplet" DisplayName="Triplet" Category="Conditional" Subtype="Text" Description="Specifies the triplet used by Vcpkg. Does not include the '-static' suffix that may be added by the 'Use static libraries' flag." /> + <StringProperty Name="VcpkgHostTriplet" DisplayName="Host Triplet" Category="Conditional" Subtype="Text" + Description="Specifies the host triplet used by Vcpkg. If empty, this will be automatically determined." /> + <StringProperty Name="VcpkgAdditionalInstallOptions" DisplayName="Additional Options" Category="General" Subtype="Text" Description="Additional command line options to be passed to the underlying vcpkg tool when installing in manifest mode." /> 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 @@ <VcpkgConfigSubdir Condition="'$(VcpkgNormalizedConfiguration)' == 'Debug'">debug\</VcpkgConfigSubdir> <VcpkgApplocalDeps Condition="'$(VcpkgApplocalDeps)' == ''">true</VcpkgApplocalDeps> + + <_ZVcpkgHostTripletParameter Condition="'$(VcpkgHostTriplet)' != ''">"--host-triplet=$(VcpkgHostTriplet)"</_ZVcpkgHostTripletParameter> + <_ZVcpkgExecutable>$([System.IO.Path]::Combine($(VcpkgRoot), 'vcpkg.exe'))</_ZVcpkgExecutable> + <ProjectStateLine>VcpkgTriplet=$(VcpkgTriplet):$(ProjectStateLine)</ProjectStateLine> </PropertyGroup> @@ -77,7 +81,7 @@ <Target Name="VcpkgInstallManifestDependencies" BeforeTargets="ClCompile" Condition="'$(VcpkgEnabled)' == 'true' and '$(VcpkgEnableManifest)' == 'true' and '$(VcpkgManifestInstall)' == 'true'" Inputs="@(_ZVcpkgInstallManifestDependenciesInputs)" - Outputs="$(TLogLocation)VcpkgInstallManifest$(VcpkgTriplet).read.1u.tlog;$(VcpkgInstalledDir).msbuildstamp-$(VcpkgTriplet)"> + Outputs="$(TLogLocation)VcpkgInstallManifest$(VcpkgTriplet).read.1u.tlog;$(VcpkgInstalledDir).msbuildstamp-$(VcpkgTriplet).$(VcpkgHostTriplet).stamp"> <Message Text="Installing vcpkg dependencies to $(VcpkgInstalledDir)" Importance="High" /> <MakeDir Directories="$(TLogLocation)" /> <ItemGroup> @@ -85,15 +89,15 @@ <_VcpkgItemToDelete Include="$(VcpkgInstalledDir).msbuildstamp-*" /> </ItemGroup> <Delete Files="@(_VcpkgItemToDelete)" /> - <Message Text="%22$([System.IO.Path]::Combine($(VcpkgRoot), 'vcpkg.exe'))%22 install --x-wait-for-lock --triplet %22$(VcpkgTriplet)%22 --vcpkg-root %22$(VcpkgRoot)\%22 %22--x-manifest-root=$(VcpkgManifestRoot)\%22 %22--x-install-root=$(VcpkgInstalledDir)\%22 $(VcpkgAdditionalInstallOptions)" + <Message Text="%22$(_ZVcpkgExecutable)%22 install $(_ZVcpkgHostTripletParameter) --x-wait-for-lock --triplet %22$(VcpkgTriplet)%22 --vcpkg-root %22$(VcpkgRoot)\%22 %22--x-manifest-root=$(VcpkgManifestRoot)\%22 %22--x-install-root=$(VcpkgInstalledDir)\%22 $(VcpkgAdditionalInstallOptions)" Importance="High" /> - <Exec Command="%22$([System.IO.Path]::Combine($(VcpkgRoot), 'vcpkg.exe'))%22 install --x-wait-for-lock --triplet %22$(VcpkgTriplet)%22 --vcpkg-root %22$(VcpkgRoot)\%22 %22--x-manifest-root=$(VcpkgManifestRoot)\%22 %22--x-install-root=$(VcpkgInstalledDir)\%22 $(VcpkgAdditionalInstallOptions)" + <Exec Command="%22$(_ZVcpkgExecutable)%22 install $(_ZVcpkgHostTripletParameter) --x-wait-for-lock --triplet %22$(VcpkgTriplet)%22 --vcpkg-root %22$(VcpkgRoot)\%22 %22--x-manifest-root=$(VcpkgManifestRoot)\%22 %22--x-install-root=$(VcpkgInstalledDir)\%22 $(VcpkgAdditionalInstallOptions)" StandardOutputImportance="High" /> - <WriteLinesToFile File="$(TLogLocation)VcpkgInstallManifest$(VcpkgTriplet).read.1u.tlog" + <WriteLinesToFile File="$(TLogLocation)VcpkgInstallManifest$(VcpkgTriplet).$(VcpkgHostTriplet).read.1u.tlog" Lines="@(_VcpkgInstallManifestDependenciesInputs -> '^%(Identity)')" Encoding="Unicode" Overwrite="true"/> - <Touch Files="$(VcpkgInstalledDir).msbuildstamp-$(VcpkgTriplet)" AlwaysCreate="true" /> + <Touch Files="$(VcpkgInstalledDir).msbuildstamp-$(VcpkgTriplet).$(VcpkgHostTriplet).stamp" AlwaysCreate="true" /> <CreateProperty Value="false"> <Output TaskParameter="ValueSetByTask" PropertyName="Link_MinimalRebuildFromTracking" /> 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}") |
