Skip to content

Commit

Permalink
Added support for custom MSVC install directories in build-msvc.bat s…
Browse files Browse the repository at this point in the history
…cript.
  • Loading branch information
chrismile committed Jan 16, 2025
1 parent 6302e31 commit fe9df30
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions build-msvc.bat
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,20 @@ if defined VCINSTALLDIR (
if defined VCINSTALLDIR (
set "x=%VCINSTALLDIR_ESC:Microsoft Visual Studio\\=" & set "VsPathEnd=%"
)
if defined VCINSTALLDIR (
set cmake_generator=-G "Visual Studio %VisualStudioVersion:~0,2% %VsPathEnd:~0,4%"
if not defined VsPathEnd (
if %VisualStudioVersion:~0,2% == 14 (
set VsPathEnd=2015
) else if %VisualStudioVersion:~0,2% == 15 (
set VsPathEnd=2017
) else if %VisualStudioVersion:~0,2% == 16 (
set VsPathEnd=2019
) else if %VisualStudioVersion:~0,2% == 17 (
set VsPathEnd=2022
)
)
if not defined VCINSTALLDIR (
if defined VsPathEnd (
set cmake_generator=-G "Visual Studio %VisualStudioVersion:~0,2% %VsPathEnd:~0,4%"
) else (
set cmake_generator=
)

Expand Down

0 comments on commit fe9df30

Please sign in to comment.