From 87b6dbaa6c6fa5c4f4d6e6a3299077789437e847 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Thu, 3 Sep 2015 12:18:35 -0700 Subject: [PATCH] Visual Studio Projects: Change project file conversions adding XP support to be reasonably well behaved during a parallel build. --- Visual Studio Projects/BuildROMs.vcproj | 4 ++ Visual Studio Projects/PDP11.vcproj | 2 +- Visual Studio Projects/Pre-Build-Event.cmd | 58 ++++++++++++---------- 3 files changed, 37 insertions(+), 27 deletions(-) diff --git a/Visual Studio Projects/BuildROMs.vcproj b/Visual Studio Projects/BuildROMs.vcproj index 5fc46025..64c95129 100644 --- a/Visual Studio Projects/BuildROMs.vcproj +++ b/Visual Studio Projects/BuildROMs.vcproj @@ -26,6 +26,8 @@ > NUL if ERRORLEVEL 1 goto _next_arg findstr PlatformToolset %1 | findstr _xp >NUL if not ERRORLEVEL 1 goto _done_xp_check -echo ********************************************************* -echo ********************************************************* echo warning: The %~n1.exe binary can't run on windows XP. -echo warning: Adding Windows XP suppport to all of the project files -echo ********************************************************* -echo ********************************************************* set _XP_Support_Available= for /r "%PROGRAMDATA%" %%z in (packages\XPSupport\Win_XPSupport.msi) do if exist "%%z" set _XP_Support_Available=1 if "" == "%_XP_Support_Available%" goto _done_xp_check +if exist PlatformToolset.fix exit /b 1 +echo. >>PlatformToolset.fix +if ERRORLEVEL 1 exit /B 1 +set /a _SleepTime= 4 + %RANDOM% %% %NUMBER_OF_PROCESSORS% +ping -n %_SleepTime% localhost > NUL +echo warning: Adding Windows XP suppport to all project files at %TIME% -echo Set objFSO = CreateObject("Scripting.FileSystemObject") >>PlatformToolset.fix.vbs -echo Set objFile = objFSO.OpenTextFile(Wscript.Arguments(0), 1) >>PlatformToolset.fix.vbs -echo. >>PlatformToolset.fix.vbs -echo strText = objFile.ReadAll >>PlatformToolset.fix.vbs -echo objFile.Close >>PlatformToolset.fix.vbs -echo strNewText = Replace(strText, "", "_xp") >>PlatformToolset.fix.vbs -echo. >>PlatformToolset.fix.vbs -echo Set objFile = objFSO.OpenTextFile(Wscript.Arguments(0), 2) >>PlatformToolset.fix.vbs -echo objFile.Write strNewText >>PlatformToolset.fix.vbs -echo objFile.Close >>PlatformToolset.fix.vbs -cd -for %%f in (*.vcxproj) do call :_Fix_PlatformToolset %%f -del PlatformToolset.fix.vbs -echo ********************************************************* -echo ********************************************************* +echo Set objFSO = CreateObject("Scripting.FileSystemObject") >>%1.fix.vbs +echo Set objFile = objFSO.OpenTextFile(Wscript.Arguments(0), 1) >>%1.fix.vbs +echo. >>%1.fix.vbs +echo strText = objFile.ReadAll >>%1.fix.vbs +echo objFile.Close >>%1.fix.vbs +echo strNewText = Replace(strText, "", "_xp") >>%1.fix.vbs +echo. >>%1.fix.vbs +echo Set objFile = objFSO.OpenTextFile(Wscript.Arguments(0), 2) >>%1.fix.vbs +echo objFile.Write strNewText >>%1.fix.vbs +echo objFile.Close >>%1.fix.vbs + +call :_Fix_PlatformToolset %1 %1 +for %%f in (*.vcxproj) do call :_Fix_PlatformToolset %1 %%f +call :_GitHooks +del %1.fix.vbs +rem wait a bit here to allow a parallel build of the to complete additional projects +ping -n 10 localhost > NUL +del PlatformToolset.fix echo Error: Reload the changed projects and start the build again -echo ********************************************************* -echo ********************************************************* exit /B 1 :_Fix_PlatformToolset -findstr PlatformToolset %1 >NUL +findstr PlatformToolset %2 >NUL if ERRORLEVEL 1 exit /B 0 -findstr PlatformToolset %1 | findstr _xp >NUL +findstr PlatformToolset %2 | findstr _xp >NUL if not ERRORLEVEL 1 exit /B 0 -echo Adding XP support to project %1 -cscript PlatformToolset.fix.vbs %1 > NUL 2>&1 +echo Adding XP support to project %2 +cscript %1.fix.vbs %2 > NUL 2>&1 exit /B 0 :_done_xp_check shift