From 8437c7a70699e39642d919733ff651a34b8c3b1f Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Wed, 27 Aug 2025 03:35:01 -0400 Subject: [PATCH] projects: fix Windows project 'clean' function - Fix generate.bat "-clean" option. - Minor change to version template substitutes to match old files, eg go back to using format version "11.00" instead of "11.0". - Do not remove the VC directories during clean, instead remove just the generated project files. Removing the VC directories has the unwanted behavior of removing files other than those generated. Visual Studio will generate its own preference files (like if you have some debug arguments in your .suo) and those files sit in the VC directories. We ignore these files and they are the user's files and should not be deleted. Also the user (such as me) may have their own untracked files that we shouldn't be deleting. Follow-up to 57d349fe which consolidated the project templates. Closes #xxxx --- projects/generate.bat | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/projects/generate.bat b/projects/generate.bat index 14e57d257b..b3990b42d1 100644 --- a/projects/generate.bat +++ b/projects/generate.bat @@ -109,8 +109,8 @@ rem :generate_proj echo. echo Generating %1 project files - md Windows\%1\lib - md Windows\%1\src + if not exist Windows\%1\lib md Windows\%1\lib + if not exist Windows\%1\src md Windows\%1\src call :generate %1 Windows\tmpl\curl-all.sln Windows\%1\curl-all.sln call :generate %1 Windows\tmpl\curl.sln Windows\%1\src\curl.sln call :generate %1 Windows\tmpl\curl.vcxproj.tmpl Windows\%1\src\curl.vcxproj @@ -125,10 +125,16 @@ rem Main project clean function. rem rem %1 - version rem -:generate_proj +:clean_proj echo. echo Removing %1 project files - rd /Q /S Windows\%1 + call :clean Windows\%1\curl-all.sln + call :clean Windows\%1\src\curl.sln + call :clean Windows\%1\src\curl.vcxproj + call :clean Windows\%1\src\curl.vcxproj.filters + call :clean Windows\%1\lib\libcurl.sln + call :clean Windows\%1\lib\libcurl.vcxproj + call :clean Windows\%1\lib\libcurl.vcxproj.filters exit /B @@ -156,23 +162,23 @@ rem set "S05=$TOOLSVER" if "%1" == "VC10" ( - set "R01=11.0" + set "R01=11.00" set "R02=2010" set "R03=v100" set "R04=VC10" set "R05=4.0" ) else if "%1%" == "VC11" ( - set "R01=12.0" + set "R01=12.00" set "R02=2012" set "R03=v110" set "R04=VC11" set "R05=4.0" ) else if "%1%" == "VC12" ( - set "R01=12.0" + set "R01=12.00" set "R02=2013" set "R03=v120" set "R04=VC12" - set "R05=12.0" + set "R05=4.0" ) echo * %CD%\%3