Fossil SCM
Refine the batch file used to build with MSVC to permit use of a pre-existing build environment.
Commit
214b1d0a37487c94d0791f76a68198cea5f7885d
Parent
d4044fe220f66a9…
1 file changed
+31
-14
+31
-14
| --- win/buildmsvc.bat | ||
| +++ win/buildmsvc.bat | ||
| @@ -13,10 +13,33 @@ | ||
| 13 | 13 | REM SET __ECHO=ECHO |
| 14 | 14 | REM SET __ECHO2=ECHO |
| 15 | 15 | IF NOT DEFINED _AECHO (SET _AECHO=REM) |
| 16 | 16 | IF NOT DEFINED _CECHO (SET _CECHO=REM) |
| 17 | 17 | IF NOT DEFINED _VECHO (SET _VECHO=REM) |
| 18 | + | |
| 19 | +REM | |
| 20 | +REM NOTE: Setup local environment variables that point to the root directory | |
| 21 | +REM of the Fossil source checkout and to the directory containing this | |
| 22 | +REM build tool. | |
| 23 | +REM | |
| 24 | +SET ROOT=%~dp0\.. | |
| 25 | +SET ROOT=%ROOT:\\=\% | |
| 26 | + | |
| 27 | +%_VECHO% Root = '%ROOT%' | |
| 28 | + | |
| 29 | +SET TOOLS=%~dp0 | |
| 30 | +SET TOOLS=%TOOLS:~0,-1% | |
| 31 | + | |
| 32 | +%_VECHO% Tools = '%TOOLS%' | |
| 33 | + | |
| 34 | +REM | |
| 35 | +REM Visual C++ ???? | |
| 36 | +REM | |
| 37 | +IF DEFINED VCINSTALLDIR IF EXIST "%VCINSTALLDIR%" ( | |
| 38 | + %_AECHO% Build environment appears to be setup. | |
| 39 | + GOTO skip_setupVisualStudio | |
| 40 | +) | |
| 18 | 41 | |
| 19 | 42 | REM |
| 20 | 43 | REM Visual Studio ???? |
| 21 | 44 | REM |
| 22 | 45 | IF DEFINED VSVARS32 IF EXIST "%VSVARS32%" ( |
| @@ -121,24 +144,10 @@ | ||
| 121 | 144 | REM |
| 122 | 145 | SET VSVARS32=%VSVARS32:\\=\% |
| 123 | 146 | |
| 124 | 147 | %_VECHO% VsVars32 = '%VSVARS32%' |
| 125 | 148 | |
| 126 | -REM | |
| 127 | -REM NOTE: Setup local environment variables that point to the root directory | |
| 128 | -REM of the Fossil source checkout and to the directory containing this | |
| 129 | -REM build tool. | |
| 130 | -REM | |
| 131 | -SET ROOT=%~dp0\.. | |
| 132 | -SET ROOT=%ROOT:\\=\% | |
| 133 | - | |
| 134 | -SET TOOLS=%~dp0 | |
| 135 | -SET TOOLS=%TOOLS:~0,-1% | |
| 136 | - | |
| 137 | -%_VECHO% Root = '%ROOT%' | |
| 138 | -%_VECHO% Tools = '%TOOLS%' | |
| 139 | - | |
| 140 | 149 | REM |
| 141 | 150 | REM NOTE: After this point, a clean ERRORLEVEL is required; therefore, make |
| 142 | 151 | REM sure it is reset now. |
| 143 | 152 | REM |
| 144 | 153 | CALL :fn_ResetErrorLevel |
| @@ -152,10 +161,18 @@ | ||
| 152 | 161 | IF ERRORLEVEL 1 ( |
| 153 | 162 | ECHO Visual Studio build environment batch file "%VSVARS32%" failed. |
| 154 | 163 | GOTO errors |
| 155 | 164 | ) |
| 156 | 165 | |
| 166 | +REM | |
| 167 | +REM NOTE: After this point, the environment should already be setup for | |
| 168 | +REM building with MSVC. | |
| 169 | +REM | |
| 170 | +:skip_setupVisualStudio | |
| 171 | + | |
| 172 | +%_VECHO% VcInstallDir = '%VCINSTALLDIR%' | |
| 173 | + | |
| 157 | 174 | REM |
| 158 | 175 | REM NOTE: Attempt to create the build output directory, if necessary. |
| 159 | 176 | REM |
| 160 | 177 | IF NOT EXIST "%ROOT%\msvcbld" ( |
| 161 | 178 | %__ECHO% MKDIR "%ROOT%\msvcbld" |
| 162 | 179 |
| --- win/buildmsvc.bat | |
| +++ win/buildmsvc.bat | |
| @@ -13,10 +13,33 @@ | |
| 13 | REM SET __ECHO=ECHO |
| 14 | REM SET __ECHO2=ECHO |
| 15 | IF NOT DEFINED _AECHO (SET _AECHO=REM) |
| 16 | IF NOT DEFINED _CECHO (SET _CECHO=REM) |
| 17 | IF NOT DEFINED _VECHO (SET _VECHO=REM) |
| 18 | |
| 19 | REM |
| 20 | REM Visual Studio ???? |
| 21 | REM |
| 22 | IF DEFINED VSVARS32 IF EXIST "%VSVARS32%" ( |
| @@ -121,24 +144,10 @@ | |
| 121 | REM |
| 122 | SET VSVARS32=%VSVARS32:\\=\% |
| 123 | |
| 124 | %_VECHO% VsVars32 = '%VSVARS32%' |
| 125 | |
| 126 | REM |
| 127 | REM NOTE: Setup local environment variables that point to the root directory |
| 128 | REM of the Fossil source checkout and to the directory containing this |
| 129 | REM build tool. |
| 130 | REM |
| 131 | SET ROOT=%~dp0\.. |
| 132 | SET ROOT=%ROOT:\\=\% |
| 133 | |
| 134 | SET TOOLS=%~dp0 |
| 135 | SET TOOLS=%TOOLS:~0,-1% |
| 136 | |
| 137 | %_VECHO% Root = '%ROOT%' |
| 138 | %_VECHO% Tools = '%TOOLS%' |
| 139 | |
| 140 | REM |
| 141 | REM NOTE: After this point, a clean ERRORLEVEL is required; therefore, make |
| 142 | REM sure it is reset now. |
| 143 | REM |
| 144 | CALL :fn_ResetErrorLevel |
| @@ -152,10 +161,18 @@ | |
| 152 | IF ERRORLEVEL 1 ( |
| 153 | ECHO Visual Studio build environment batch file "%VSVARS32%" failed. |
| 154 | GOTO errors |
| 155 | ) |
| 156 | |
| 157 | REM |
| 158 | REM NOTE: Attempt to create the build output directory, if necessary. |
| 159 | REM |
| 160 | IF NOT EXIST "%ROOT%\msvcbld" ( |
| 161 | %__ECHO% MKDIR "%ROOT%\msvcbld" |
| 162 |
| --- win/buildmsvc.bat | |
| +++ win/buildmsvc.bat | |
| @@ -13,10 +13,33 @@ | |
| 13 | REM SET __ECHO=ECHO |
| 14 | REM SET __ECHO2=ECHO |
| 15 | IF NOT DEFINED _AECHO (SET _AECHO=REM) |
| 16 | IF NOT DEFINED _CECHO (SET _CECHO=REM) |
| 17 | IF NOT DEFINED _VECHO (SET _VECHO=REM) |
| 18 | |
| 19 | REM |
| 20 | REM NOTE: Setup local environment variables that point to the root directory |
| 21 | REM of the Fossil source checkout and to the directory containing this |
| 22 | REM build tool. |
| 23 | REM |
| 24 | SET ROOT=%~dp0\.. |
| 25 | SET ROOT=%ROOT:\\=\% |
| 26 | |
| 27 | %_VECHO% Root = '%ROOT%' |
| 28 | |
| 29 | SET TOOLS=%~dp0 |
| 30 | SET TOOLS=%TOOLS:~0,-1% |
| 31 | |
| 32 | %_VECHO% Tools = '%TOOLS%' |
| 33 | |
| 34 | REM |
| 35 | REM Visual C++ ???? |
| 36 | REM |
| 37 | IF DEFINED VCINSTALLDIR IF EXIST "%VCINSTALLDIR%" ( |
| 38 | %_AECHO% Build environment appears to be setup. |
| 39 | GOTO skip_setupVisualStudio |
| 40 | ) |
| 41 | |
| 42 | REM |
| 43 | REM Visual Studio ???? |
| 44 | REM |
| 45 | IF DEFINED VSVARS32 IF EXIST "%VSVARS32%" ( |
| @@ -121,24 +144,10 @@ | |
| 144 | REM |
| 145 | SET VSVARS32=%VSVARS32:\\=\% |
| 146 | |
| 147 | %_VECHO% VsVars32 = '%VSVARS32%' |
| 148 | |
| 149 | REM |
| 150 | REM NOTE: After this point, a clean ERRORLEVEL is required; therefore, make |
| 151 | REM sure it is reset now. |
| 152 | REM |
| 153 | CALL :fn_ResetErrorLevel |
| @@ -152,10 +161,18 @@ | |
| 161 | IF ERRORLEVEL 1 ( |
| 162 | ECHO Visual Studio build environment batch file "%VSVARS32%" failed. |
| 163 | GOTO errors |
| 164 | ) |
| 165 | |
| 166 | REM |
| 167 | REM NOTE: After this point, the environment should already be setup for |
| 168 | REM building with MSVC. |
| 169 | REM |
| 170 | :skip_setupVisualStudio |
| 171 | |
| 172 | %_VECHO% VcInstallDir = '%VCINSTALLDIR%' |
| 173 | |
| 174 | REM |
| 175 | REM NOTE: Attempt to create the build output directory, if necessary. |
| 176 | REM |
| 177 | IF NOT EXIST "%ROOT%\msvcbld" ( |
| 178 | %__ECHO% MKDIR "%ROOT%\msvcbld" |
| 179 |