Fossil SCM

Update buildmsvc.bat to be able to be called in a normal command prompt and automatically load the needed MSVC build tools (x64 by default; x86 can be given as the first argument).

danield 2024-03-25 15:48 trunk
Commit 97971b9666180e7d5bcbf7577ff5d6736bbf0d93d4e9d08d345b6d3e0eed4c4a
1 file changed +7 -2
--- win/buildmsvc.bat
+++ win/buildmsvc.bat
@@ -1,13 +1,15 @@
11
@ECHO OFF
22
33
::
44
:: buildmsvc.bat --
55
::
6
-:: This batch file attempts to build Fossil using the latest version
6
+:: This batch file attempts to build Fossil using the latest version of
77
:: Microsoft Visual Studio installed on this machine.
88
::
9
+:: For VS 2017 and later, it uses the x64 build tools by default;
10
+:: pass "x86" as the first argument to use the x86 tools.
911
::
1012
1113
SETLOCAL
1214
1315
REM SET __ECHO=ECHO
@@ -50,11 +52,14 @@
5052
REM
5153
REM Visual Studio 2017 / 2019 / 2022
5254
REM
5355
CALL :fn_TryUseVsWhereExe
5456
IF NOT DEFINED VSWHEREINSTALLDIR GOTO skip_detectVisualStudio2017
55
-SET VSVARS32=%VSWHEREINSTALLDIR%\Common7\Tools\VsDevCmd.bat
57
+SET VSVARS32=%VSWHEREINSTALLDIR%\VC\Auxiliary\Build\vcvars64.bat
58
+IF "%~1" == "x86" (
59
+ SET VSVARS32=%VSWHEREINSTALLDIR%\VC\Auxiliary\Build\vcvars32.bat
60
+)
5661
IF EXIST "%VSVARS32%" (
5762
%_AECHO% Using Visual Studio 2017 / 2019 / 2022...
5863
GOTO skip_detectVisualStudio
5964
)
6065
:skip_detectVisualStudio2017
6166
--- win/buildmsvc.bat
+++ win/buildmsvc.bat
@@ -1,13 +1,15 @@
1 @ECHO OFF
2
3 ::
4 :: buildmsvc.bat --
5 ::
6 :: This batch file attempts to build Fossil using the latest version
7 :: Microsoft Visual Studio installed on this machine.
8 ::
 
 
9 ::
10
11 SETLOCAL
12
13 REM SET __ECHO=ECHO
@@ -50,11 +52,14 @@
50 REM
51 REM Visual Studio 2017 / 2019 / 2022
52 REM
53 CALL :fn_TryUseVsWhereExe
54 IF NOT DEFINED VSWHEREINSTALLDIR GOTO skip_detectVisualStudio2017
55 SET VSVARS32=%VSWHEREINSTALLDIR%\Common7\Tools\VsDevCmd.bat
 
 
 
56 IF EXIST "%VSVARS32%" (
57 %_AECHO% Using Visual Studio 2017 / 2019 / 2022...
58 GOTO skip_detectVisualStudio
59 )
60 :skip_detectVisualStudio2017
61
--- win/buildmsvc.bat
+++ win/buildmsvc.bat
@@ -1,13 +1,15 @@
1 @ECHO OFF
2
3 ::
4 :: buildmsvc.bat --
5 ::
6 :: This batch file attempts to build Fossil using the latest version of
7 :: Microsoft Visual Studio installed on this machine.
8 ::
9 :: For VS 2017 and later, it uses the x64 build tools by default;
10 :: pass "x86" as the first argument to use the x86 tools.
11 ::
12
13 SETLOCAL
14
15 REM SET __ECHO=ECHO
@@ -50,11 +52,14 @@
52 REM
53 REM Visual Studio 2017 / 2019 / 2022
54 REM
55 CALL :fn_TryUseVsWhereExe
56 IF NOT DEFINED VSWHEREINSTALLDIR GOTO skip_detectVisualStudio2017
57 SET VSVARS32=%VSWHEREINSTALLDIR%\VC\Auxiliary\Build\vcvars64.bat
58 IF "%~1" == "x86" (
59 SET VSVARS32=%VSWHEREINSTALLDIR%\VC\Auxiliary\Build\vcvars32.bat
60 )
61 IF EXIST "%VSVARS32%" (
62 %_AECHO% Using Visual Studio 2017 / 2019 / 2022...
63 GOTO skip_detectVisualStudio
64 )
65 :skip_detectVisualStudio2017
66

Keyboard Shortcuts

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