@@ -10,7 +10,12 @@ echo.given.
10
10
echo .
11
11
echo .After the flags recognized by this script, up to 9 arguments to be passed
12
12
echo .directly to MSBuild may be passed. If the argument contains an '=', the
13
- echo .entire argument must be quoted (e.g. `%~nx0 " /p:PlatformToolset=v100" `)
13
+ echo .entire argument must be quoted (e.g. `%~nx0 " /p:PlatformToolset=v100" `).
14
+ echo .Alternatively you can put extra flags for MSBuild in a file named
15
+ echo .`msbuild.rsp` in the `PCbuild` directory, one flag per line. This file
16
+ echo .will be picked automatically by MSBuild. Flags put in this file does not
17
+ echo .need to be quoted. You can still use environment variables inside the
18
+ echo .response file.
14
19
echo .
15
20
echo .Available flags:
16
21
echo . -h Display this help message
@@ -47,7 +52,6 @@ exit /b 127
47
52
:Run
48
53
setlocal
49
54
set platf = Win32
50
- set vs_platf = x86
51
55
set conf = Release
52
56
set target = Build
53
57
set dir = %~dp0
@@ -56,10 +60,6 @@ set verbose=/nologo /v:m
56
60
set kill =
57
61
set do_pgo =
58
62
set pgo_job = -m test.regrtest --pgo
59
- set on_64_bit = true
60
-
61
- rem This may not be 100% accurate, but close enough.
62
- if " %ProgramFiles(x86)% " == " " (set on_64_bit=false)
63
63
64
64
:CheckOpts
65
65
if " %~1 " == " -h" goto Usage
@@ -89,18 +89,12 @@ if "%IncludeBsddb%"=="" set IncludeBsddb=true
89
89
90
90
if " %IncludeExternals% " == " true" call " %dir% get_externals.bat"
91
91
92
- if " %platf% " == " x64" (
93
- if " %on_64_bit% " == " true" (
94
- rem This ought to always be correct these days...
95
- set vs_platf = amd64
96
- ) else (
97
- if " %do_pgo% " == " true" (
98
- echo .ERROR: Cannot cross-compile with PGO
99
- echo . 32bit operating system detected, if this is incorrect,
100
- echo . make sure the ProgramFiles(x86^ ) environment variable is set
101
- exit /b 1
102
- )
103
- set vs_platf = x86_amd64
92
+ if " %do_pgo% " EQU " true" if " %platf% " EQU " x64" (
93
+ if " %PROCESSOR_ARCHITEW6432% " NEQ " AMD64" if " %PROCESSOR_ARCHITECTURE% " NEQ " AMD64" (
94
+ echo .ERROR: Cannot cross-compile with PGO
95
+ echo . 32bit operating system detected. Ensure your PROCESSOR_ARCHITECTURE
96
+ echo . and PROCESSOR_ARCHITEW6432 environment variables are correct.
97
+ exit /b 1
104
98
)
105
99
)
106
100
@@ -109,26 +103,28 @@ if exist "%GIT%" set GITProperty=/p:GIT="%GIT%"
109
103
if not exist " %GIT% " echo Cannot find Git on PATH & set GITProperty =
110
104
111
105
rem Setup the environment
112
- call " %dir% env.bat" %vs_platf% > nul
106
+ call " %dir% find_msbuild.bat" %MSBUILD%
107
+ if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2)
113
108
114
109
if " %kill% " == " true" call :Kill
115
110
116
111
if " %do_pgo% " == " true" (
117
112
set conf = PGInstrument
118
- call :Build
113
+ call :Build %1 %2 %3 %4 %5 %6 %7 %8 %9
119
114
del /s " %dir% \*.pgc"
120
115
del /s " %dir% \..\Lib\*.pyc"
121
116
echo on
122
117
call " %dir% \..\python.bat" %pgo_job%
123
118
@ echo off
124
119
call :Kill
125
120
set conf = PGUpdate
121
+ set target = Build
126
122
)
127
123
goto Build
128
124
129
125
:Kill
130
126
echo on
131
- msbuild " %dir% \pythoncore.vcxproj" /t:KillPython %verbose% ^
127
+ %MSBUILD% " %dir% \pythoncore.vcxproj" /t:KillPython %verbose% ^
132
128
/p:Configuration=%conf% /p:Platform=%platf% ^
133
129
/p:KillPython=true
134
130
@@ -140,7 +136,7 @@ rem Call on MSBuild to do the work, echo the command.
140
136
rem Passing %1-9 is not the preferred option, but argument parsing in
141
137
rem batch is, shall we say, "lackluster"
142
138
echo on
143
- msbuild " %dir% pcbuild.proj" /t:%target% %parallel% %verbose% ^
139
+ %MSBUILD% " %dir% pcbuild.proj" /t:%target% %parallel% %verbose% ^
144
140
/p:Configuration=%conf% /p:Platform=%platf% ^
145
141
/p:IncludeExternals=%IncludeExternals% ^
146
142
/p:IncludeSSL=%IncludeSSL% /p:IncludeTkinter=%IncludeTkinter% ^
0 commit comments