git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] Make just opening the generated MSVC solution file not modify it

From
Marius Storm-Olsen <mstormo@gmail.com>
Date
Sep 28, 2009, 11:34 UTC
Message-ID
<f8aa063d3a2be33146b3626c4908ce1f64d9c7ac.1254137149.git.mstormo@gmail.com>
In-Reply-To
<cover.1254137149.git.mstormo@gmail.com>
From: Sebastian Schuberth <sschuberth@gmail.com>

The format of the generated MSVC solution file is fixed in a way that just opening it in Visual Studio and immediately closing it again without performing any modifications does not trigger a prompt to save the solution file. This behavior was caused by several minor incompatibilities between the generated file and what Visual Studio 2008 expected, so Visual Studio transparently fixed the file format, marking it internally as modified.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Acked-by: Marius Storm-Olsen <mstormo@gmail.com>
---
 contrib/buildsystems/Generators/Vcproj.pm |   42 +++++++---------------------
 1 files changed, 11 insertions(+), 31 deletions(-)
diff --git a/contrib/buildsystems/Generators/Vcproj.pm b/contrib/buildsystems/Generators/Vcproj.pm
index 50daa03..d53ff2c 100644
--- a/contrib/buildsystems/Generators/Vcproj.pm
+++ b/contrib/buildsystems/Generators/Vcproj.pm
@@ -571,45 +571,29 @@ sub createGlueProject {
         print F "\"${libname}\", \"${libname}\\${libname}.vcproj\", \"${uuid}\"";
         print F "$SLN_POST";
     }
+    my $uuid_libgit = $build_structure{"LIBS_libgit_GUID"};
+    my $uuid_xdiff_lib = $build_structure{"LIBS_xdiff_lib_GUID"};
     foreach (@apps) {
         my $appname = $_;
         my $uuid = $build_structure{"APPS_${appname}_GUID"};
         print F "$SLN_PRE";
-        print F "\"${appname}\", \"${appname}\\${appname}.vcproj\", \"${uuid}\"";
+        print F "\"${appname}\", \"${appname}\\${appname}.vcproj\", \"${uuid}\"\n";
+        print F "	ProjectSection(ProjectDependencies) = postProject\n";
+        print F "		${uuid_libgit} = ${uuid_libgit}\n";
+        print F "		${uuid_xdiff_lib} = ${uuid_xdiff_lib}\n";
+        print F "	EndProjectSection";
         print F "$SLN_POST";
     }
 
     print F << "EOM";
 Global
-	GlobalSection(SolutionConfiguration) = preSolution
-		ConfigName.0 = Debug|Win32
-		ConfigName.1 = Release|Win32
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Release|Win32 = Release|Win32
 	EndGlobalSection
-	GlobalSection(ProjectDependencies) = postSolution
 EOM
-    foreach (@{$build_structure{"APPS"}}) {
-        my $appname = $_;
-        my $appname_clean = $_;
-        $appname_clean =~ s/\//_/g;
-        $appname_clean =~ s/\.exe//;
-
-        my $uuid = $build_structure{"APPS_${appname_clean}_GUID"};
-        my $dep_index = 0;
-        foreach(@{$build_structure{"APPS_${appname}_LIBS"}}) {
-            my $libname = $_;
-            $libname =~ s/\//_/g;
-            $libname =~ s/\.(a|lib)//;
-            my $libuuid = $build_structure{"LIBS_${libname}_GUID"};
-            if (defined $libuuid) {
-                print F "\t\t${uuid}.${dep_index} = ${libuuid}\n";
-                $dep_index += 1;
-            }
-        }
-    }
-
     print F << "EOM";
-	EndGlobalSection
-	GlobalSection(ProjectConfiguration) = postSolution
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 EOM
     foreach (@libs) {
         my $libname = $_;
@@ -630,10 +614,6 @@ EOM
 
     print F << "EOM";
 	EndGlobalSection
-	GlobalSection(ExtensibilityGlobals) = postSolution
-	EndGlobalSection
-	GlobalSection(ExtensibilityAddIns) = postSolution
-	EndGlobalSection
 EndGlobal
 EOM
     close F;
-- 
1.6.5.rc2.177.ga9dd6
Previous: Marius Storm-OlsenNext: Sebastian Schuberth
Message 15 of 16 in “Make generated MSVC solution file open from Windows Explorer”
  1. 1/2 Make generated MSVC solution file open from Windows ExplorerSebastian Schuberth, Sep 24, 2009
  2. Shawn O. PearceSep 25, 2009
  3. Alex RiesenSep 25, 2009
  4. Sebastian SchuberthSep 25, 2009
  5. Sebastian SchuberthSep 25, 2009
  6. Shawn O. PearceSep 25, 2009
  7. Sebastian SchuberthSep 25, 2009
  8. Shawn O. PearceSep 26, 2009
  9. Sebastian SchuberthSep 26, 2009
  10. Shawn O. PearceSep 26, 2009
  11. BazSep 28, 2009
  12. Sebastian SchuberthSep 28, 2009
  13. 0/2 MSVC generator fixupsMarius Storm-Olsen, Sep 28, 2009
  14. 1/2 Make generated MSVC solution file open from Windows ExplorerMarius Storm-Olsen, Sep 28, 2009
  15. 2/2 Make just opening the generated MSVC solution file not modify itMarius Storm-Olsen, Sep 28, 2009
  16. Sebastian SchuberthSep 28, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.