Fossil SCM

Support out-of-source build on Windows when BUILDDIR envvar is not set.

ashepilko 2020-07-17 22:02 trunk
Commit 0f0b904337150bd54852966dac0ccfe509aa368b91bc1dc3e49ae4ec428b2d9b
1 file changed +10 -2
--- win/buildmsvc.bat
+++ win/buildmsvc.bat
@@ -195,17 +195,25 @@
195195
REM
196196
) ELSE (
197197
REM
198198
REM NOTE: The build suffix is not present, add it now.
199199
REM
200
- SET BUILDDIR=%BUILDDIR%%BUILDSUFFIX%
200
+ SET "BUILDDIR=%BUILDDIR%%BUILDSUFFIX%"
201201
)
202202
203203
CALL :fn_ResetErrorLevel
204204
)
205205
) ELSE (
206
- SET BUILDDIR=%ROOT%\msvcbld%BUILDSUFFIX%
206
+ REM
207
+ REM When BUILDDIR is not defined, build in the current directory.
208
+ REM For compatibility, create the build artifacts in 'msvcbld'
209
+ REM subdirectory (similar to how the Linux build is done).
210
+ REM
211
+ REM USECASE-1: in-source build (current dir is %ROOT%)
212
+ REM USECASE-2: out-of-source build (current dir is arbitrary)
213
+ REM
214
+ SET "BUILDDIR=%CD%\msvcbld%BUILDSUFFIX%"
207215
)
208216
209217
%_VECHO% BuildSuffix = '%BUILDSUFFIX%'
210218
%_VECHO% BuildDir = '%BUILDDIR%'
211219
212220
--- win/buildmsvc.bat
+++ win/buildmsvc.bat
@@ -195,17 +195,25 @@
195 REM
196 ) ELSE (
197 REM
198 REM NOTE: The build suffix is not present, add it now.
199 REM
200 SET BUILDDIR=%BUILDDIR%%BUILDSUFFIX%
201 )
202
203 CALL :fn_ResetErrorLevel
204 )
205 ) ELSE (
206 SET BUILDDIR=%ROOT%\msvcbld%BUILDSUFFIX%
 
 
 
 
 
 
 
 
207 )
208
209 %_VECHO% BuildSuffix = '%BUILDSUFFIX%'
210 %_VECHO% BuildDir = '%BUILDDIR%'
211
212
--- win/buildmsvc.bat
+++ win/buildmsvc.bat
@@ -195,17 +195,25 @@
195 REM
196 ) ELSE (
197 REM
198 REM NOTE: The build suffix is not present, add it now.
199 REM
200 SET "BUILDDIR=%BUILDDIR%%BUILDSUFFIX%"
201 )
202
203 CALL :fn_ResetErrorLevel
204 )
205 ) ELSE (
206 REM
207 REM When BUILDDIR is not defined, build in the current directory.
208 REM For compatibility, create the build artifacts in 'msvcbld'
209 REM subdirectory (similar to how the Linux build is done).
210 REM
211 REM USECASE-1: in-source build (current dir is %ROOT%)
212 REM USECASE-2: out-of-source build (current dir is arbitrary)
213 REM
214 SET "BUILDDIR=%CD%\msvcbld%BUILDSUFFIX%"
215 )
216
217 %_VECHO% BuildSuffix = '%BUILDSUFFIX%'
218 %_VECHO% BuildDir = '%BUILDDIR%'
219
220

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button