]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
projects: fix Windows project 'clean' function
authorJay Satiro <raysatiro@yahoo.com>
Wed, 27 Aug 2025 07:35:01 +0000 (03:35 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Tue, 2 Sep 2025 14:34:48 +0000 (10:34 -0400)
- Fix generate.bat "-clean" option.

- Change version template substitutes to match old files, eg go back to
  using format version "11.00" instead of "11.0".

- Limit the vcxproj filters file types that are filtered to c, h, rc.

- Get rid of the tmpl extension from template files and add a README
  to the tmpl directory explaining the purpose of the files.

- gitignore VCxx directories entirely rather than individual file types.

- 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 those files since
they are the user's files and should not be deleted. Also the user may
have their own untracked files that we shouldn't be deleting.

Follow-up to 57d349fe which consolidated the project templates.

Assisted-by: Viktor Szakats
Closes https://github.com/curl/curl/pull/18412

projects/Windows/.gitignore
projects/Windows/tmpl/README.txt [new file with mode: 0644]
projects/Windows/tmpl/curl-all.sln
projects/Windows/tmpl/curl.sln
projects/Windows/tmpl/curl.vcxproj [moved from projects/Windows/tmpl/curl.vcxproj.tmpl with 100% similarity]
projects/Windows/tmpl/curl.vcxproj.filters
projects/Windows/tmpl/libcurl.sln
projects/Windows/tmpl/libcurl.vcxproj [moved from projects/Windows/tmpl/libcurl.vcxproj.tmpl with 100% similarity]
projects/Windows/tmpl/libcurl.vcxproj.filters
projects/generate.bat

index f32b8558a23c5ea44c3f9511793ad94d35703c76..23ef63506204a0823d588267f41ca73ba36c12d6 100644 (file)
@@ -2,9 +2,6 @@
 #
 # SPDX-License-Identifier: curl
 
-*.ncb
-*.opensdf
-*.sdf
-*.suo
-*.user
-*.vcxproj
+VC10/
+VC11/
+VC12/
diff --git a/projects/Windows/tmpl/README.txt b/projects/Windows/tmpl/README.txt
new file mode 100644 (file)
index 0000000..08b2908
--- /dev/null
@@ -0,0 +1,6 @@
+The files in this directory are not meant to be opened with Visual Studio.
+
+This directory contains template files that are used to generate project files
+for legacy versions of Visual Studio 2010, 2012 and 2013. To generate the
+files run generate.bat in the projects directory and refer to that directory's
+README.
index 66c6d0f2f9fda9424c81ef8ad3fca100966b3b81..8f6afd4e132fa4bbfcbf9970801f8f55d7eda2f0 100644 (file)
@@ -1,5 +1,4 @@
 Microsoft Visual Studio Solution File, Format Version $FORMATVER
-# Visual Studio $FORMATYEAR
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curl", "src\curl.vcxproj", "{5228E9CE-A216-422F-A5E6-58E95E2DD71D}"
        ProjectSection(ProjectDependencies) = postProject
                {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB} = {DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}
index 01c07e4ffa9f409cd1f7b80351a1cb8bfd717e56..7e50eed99d3b6d7af885374c4405b63e134ea802 100644 (file)
@@ -1,5 +1,4 @@
 Microsoft Visual Studio Solution File, Format Version $FORMATVER
-# Visual Studio $FORMATYEAR
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "curl", "curl.vcxproj", "{5228E9CE-A216-422F-A5E6-58E95E2DD71D}"
 EndProject
 Global
index 0d9d4d5fefb7fb3bb10fbad11a83453c205963a2..793a698a452c1c6d245c2419af636499dec3f661 100644 (file)
@@ -1,17 +1,17 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="$TOOLSVER" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
     <Filter Include="Source Files">
       <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
-      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+      <Extensions>c</Extensions>
     </Filter>
     <Filter Include="Header Files">
       <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
-      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+      <Extensions>h</Extensions>
     </Filter>
     <Filter Include="Resource Files">
       <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+      <Extensions>rc</Extensions>
     </Filter>
   </ItemGroup>
 </Project>
index ef31025f83115a55824d45b69ec6ff202ed6d780..2eeb679dbc1450a4329102e8deb49ba7151a836f 100644 (file)
@@ -1,5 +1,4 @@
 Microsoft Visual Studio Solution File, Format Version $FORMATVER
-# Visual Studio $FORMATYEAR
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcurl", "libcurl.vcxproj", "{DA6F56B4-06A4-441D-AD70-AC5A7D51FADB}"
 EndProject
 Global
index 0d9d4d5fefb7fb3bb10fbad11a83453c205963a2..793a698a452c1c6d245c2419af636499dec3f661 100644 (file)
@@ -1,17 +1,17 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="$TOOLSVER" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup>
     <Filter Include="Source Files">
       <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
-      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+      <Extensions>c</Extensions>
     </Filter>
     <Filter Include="Header Files">
       <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
-      <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
+      <Extensions>h</Extensions>
     </Filter>
     <Filter Include="Resource Files">
       <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+      <Extensions>rc</Extensions>
     </Filter>
   </ItemGroup>
 </Project>
index 14e57d257bbbaa3f420720cc0327a70a3bf50144..3aebff183e9c622e235b120ce527f9ba9a526f4e 100644 (file)
@@ -109,14 +109,14 @@ 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
+  call :generate %1 Windows\tmpl\curl.vcxproj            Windows\%1\src\curl.vcxproj
   call :generate %1 Windows\tmpl\curl.vcxproj.filters    Windows\%1\src\curl.vcxproj.filters
   call :generate %1 Windows\tmpl\libcurl.sln             Windows\%1\lib\libcurl.sln
-  call :generate %1 Windows\tmpl\libcurl.vcxproj.tmpl    Windows\%1\lib\libcurl.vcxproj
+  call :generate %1 Windows\tmpl\libcurl.vcxproj         Windows\%1\lib\libcurl.vcxproj
   call :generate %1 Windows\tmpl\libcurl.vcxproj.filters Windows\%1\lib\libcurl.vcxproj.filters
 
   exit /B
@@ -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
 
@@ -150,29 +156,25 @@ rem
   )
 
   set "S01=$FORMATVER"
-  set "S02=$FORMATYEAR"
-  set "S03=$PLATFORMTOOLSET"
-  set "S04=$SUBDIR"
-  set "S05=$TOOLSVER"
+  set "S02=$PLATFORMTOOLSET"
+  set "S03=$SUBDIR"
+  set "S04=$TOOLSVER"
 
   if "%1" == "VC10" (
-    set "R01=11.0"
-    set "R02=2010"
-    set "R03=v100"
-    set "R04=VC10"
-    set "R05=4.0"
+    set "R01=11.00"
+    set "R02=v100"
+    set "R03=VC10"
+    set "R04=4.0"
   ) else if "%1%" == "VC11" (
-    set "R01=12.0"
-    set "R02=2012"
-    set "R03=v110"
-    set "R04=VC11"
-    set "R05=4.0"
+    set "R01=12.00"
+    set "R02=v110"
+    set "R03=VC11"
+    set "R04=4.0"
   ) else if "%1%" == "VC12" (
-    set "R01=12.0"
-    set "R02=2013"
-    set "R03=v120"
-    set "R04=VC12"
-    set "R05=12.0"
+    set "R01=12.00"
+    set "R02=v120"
+    set "R03=VC12"
+    set "R04=12.0"
   )
 
   echo * %CD%\%3
@@ -183,7 +185,6 @@ rem
     set "var=!var:%S02%=%R02%!"
     set "var=!var:%S03%=%R03%!"
     set "var=!var:%S04%=%R04%!"
-    set "var=!var:%S05%=%R05%!"
 
     set "var=!var:*:=!"