1
0
mirror of https://github.com/simh/simh.git synced 2026-02-27 01:00:07 +00:00

Visiual Studio Projects: handle missing XP tools when converting to VS2022

build_vstudio.bat converts the .vcproj files from Visual Studio 2008 to
.vcxproj when used with newer versions of Visual Studio and configures
it to build XP-compatible binaries using the v141_xp toolset. However,
this toolset is deprecated and may not be present when using Visual
Studio 2022. The script intends to edit the .vcxproj files only in the
case where it exists; however, due to a logic error it actually does
this unconditionally. This causes the build to fail on VS2022 when
the XP toolset is not present.
This commit is contained in:
John D. Bruner
2023-10-01 13:22:05 -10:00
committed by Mark Pizzolato
parent 575df4bd67
commit be969fe46c

View File

@@ -193,6 +193,8 @@ if not "%_VC_VER%" == "2022" goto _RunBuild
if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v150\Platforms\x64\PlatformToolsets\v141_xp" goto _DoXPConvert
if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Professional\MSBuild\Microsoft\VC\v150\Platforms\x64\PlatformToolsets\v141_xp" goto _DoXPConvert
if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v150\Platforms\x64\PlatformToolsets\v141_xp" goto _DoXPConvert
goto _RunBuild
:_DoXPConvert
set _X_PROJS_CONVERTED=
for /F "usebackq tokens=1" %%a in (`findstr /C:"<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>" "%_BUILD_PROJECT_DIR%BuildROMs.vcxproj"`) do set _X_PROJS_CONVERTED=%%a