@@ -48,7 +48,6 @@ exit /b 127
48
48
:Run
49
49
setlocal
50
50
set platf = Win32
51
- set vs_platf = x86
52
51
set conf = Release
53
52
set target = Build
54
53
set dir = %~dp0
@@ -57,10 +56,6 @@ set verbose=/nologo /v:m
57
56
set kill =
58
57
set do_pgo =
59
58
set pgo_job = -m test --pgo
60
- set on_64_bit = true
61
-
62
- rem This may not be 100% accurate, but close enough.
63
- if " %ProgramFiles(x86)% " == " " (set on_64_bit=false)
64
59
65
60
:CheckOpts
66
61
if " %~1 " == " -h" goto Usage
@@ -90,18 +85,12 @@ if "%IncludeTkinter%"=="" set IncludeTkinter=true
90
85
91
86
if " %IncludeExternals% " == " true" call " %dir% get_externals.bat"
92
87
93
- if " %platf% " == " x64" (
94
- if " %on_64_bit% " == " true" (
95
- rem This ought to always be correct these days...
96
- set vs_platf = amd64
97
- ) else (
98
- if " %do_pgo% " == " true" (
99
- echo .ERROR: Cannot cross-compile with PGO
100
- echo . 32bit operating system detected, if this is incorrect,
101
- echo . make sure the ProgramFiles(x86^ ) environment variable is set
102
- exit /b 1
103
- )
104
- set vs_platf = x86_amd64
88
+ if " %do_pgo% " EQU " true" if " %platf% " EQU " x64" (
89
+ if " %PROCESSOR_ARCHITEW6432% " NEQ " AMD64" if " %PROCESSOR_ARCHITECTURE% " NEQ " AMD64" (
90
+ echo .ERROR: Cannot cross-compile with PGO
91
+ echo . 32bit operating system detected. Ensure your PROCESSOR_ARCHITECTURE
92
+ echo . and PROCESSOR_ARCHITEW6432 environment variables are correct.
93
+ exit /b 1
105
94
)
106
95
)
107
96
@@ -110,7 +99,8 @@ if exist "%GIT%" set GITProperty=/p:GIT="%GIT%"
110
99
if not exist " %GIT% " echo Cannot find Git on PATH & set GITProperty =
111
100
112
101
rem Setup the environment
113
- call " %dir% env.bat" %vs_platf% > nul
102
+ call " %dir% find_msbuild.bat" %MSBUILD%
103
+ if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2)
114
104
115
105
if " %kill% " == " true" call :Kill
116
106
@@ -129,7 +119,7 @@ goto Build
129
119
130
120
:Kill
131
121
echo on
132
- msbuild " %dir% \pythoncore.vcxproj" /t:KillPython %verbose% ^
122
+ %MSBUILD% " %dir% \pythoncore.vcxproj" /t:KillPython %verbose% ^
133
123
/p:Configuration=%conf% /p:Platform=%platf% ^
134
124
/p:KillPython=true
135
125
@@ -141,7 +131,7 @@ rem Call on MSBuild to do the work, echo the command.
141
131
rem Passing %1-9 is not the preferred option, but argument parsing in
142
132
rem batch is, shall we say, "lackluster"
143
133
echo on
144
- msbuild " %dir% pcbuild.proj" /t:%target% %parallel% %verbose% ^
134
+ %MSBUILD% " %dir% pcbuild.proj" /t:%target% %parallel% %verbose% ^
145
135
/p:Configuration=%conf% /p:Platform=%platf% ^
146
136
/p:IncludeExternals=%IncludeExternals% ^
147
137
/p:IncludeSSL=%IncludeSSL% /p:IncludeTkinter=%IncludeTkinter% ^
@@ -153,4 +143,4 @@ goto :eof
153
143
154
144
:Version
155
145
rem Display the current build version information
156
- msbuild " %dir% python.props" /t:ShowVersionInfo /v:m /nologo %1 %2 %3 %4 %5 %6 %7 %8 %9
146
+ %MSBUILD% " %dir% python.props" /t:ShowVersionInfo /v:m /nologo %1 %2 %3 %4 %5 %6 %7 %8 %9
0 commit comments