aboutsummaryrefslogtreecommitdiff
path: root/scripts/bootstrap.ps1
diff options
context:
space:
mode:
authorccorn <ccorn@1tein.de>2019-05-21 00:48:59 +0200
committerRobert Schumacher <roschuma@microsoft.com>2019-05-20 15:48:59 -0700
commitb0b895bff642afc8bc33c827b0b4430c6f8353b2 (patch)
treebf1b8413b27f2da6c1ea8f219a1bbe46ad06942c /scripts/bootstrap.ps1
parent3c9cd10293b02b4e8a3cb6f1bcc629f662aaed46 (diff)
downloadvcpkg-b0b895bff642afc8bc33c827b0b4430c6f8353b2.tar.gz
vcpkg-b0b895bff642afc8bc33c827b0b4430c6f8353b2.zip
Bootstrap: Refining PreferredToolArchitecture (#6398)
* Patch to enable bootstrap on Win32 * [bootstrap-vcpkg] Test OS version to set PreferredToolArchitecture
Diffstat (limited to 'scripts/bootstrap.ps1')
-rw-r--r--scripts/bootstrap.ps114
1 files changed, 11 insertions, 3 deletions
diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1
index 07a9fcbaa..b195cc605 100644
--- a/scripts/bootstrap.ps1
+++ b/scripts/bootstrap.ps1
@@ -339,10 +339,9 @@ if ($disableMetrics)
$platform = "x86"
$vcpkgReleaseDir = "$vcpkgSourcesPath\msbuild.x86.release"
-
+$architecture=(Get-WmiObject win32_operatingsystem | Select-Object osarchitecture).osarchitecture
if ($win64)
{
- $architecture=(Get-WmiObject win32_operatingsystem | Select-Object osarchitecture).osarchitecture
if (-not $architecture -like "*64*")
{
throw "Cannot build 64-bit on non-64-bit system"
@@ -352,6 +351,15 @@ if ($win64)
$vcpkgReleaseDir = "$vcpkgSourcesPath\msbuild.x64.release"
}
+if ($architecture -like "*64*")
+{
+ $PreferredToolArchitecture = "x64"
+}
+else
+{
+ $PreferredToolArchitecture = "x86"
+}
+
$arguments = (
"`"/p:VCPKG_VERSION=-nohash`"",
"`"/p:DISABLE_METRICS=$disableMetricsValue`"",
@@ -359,7 +367,7 @@ $arguments = (
"/p:Platform=$platform",
"/p:PlatformToolset=$platformToolset",
"/p:TargetPlatformVersion=$windowsSDK",
-"/p:PreferredToolArchitecture=x64",
+"/p:PreferredToolArchitecture=$PreferredToolArchitecture",
"/verbosity:minimal",
"/m",
"/nologo",