{"thread":{"id":"43827","subject":"[PATCH 2/2] Make just opening the generated MSVC solution file not modify it","startedAt":"2009-09-24T14:42:42Z","lastAt":"2009-09-24T14:42:42Z","messageCount":1,"participants":["Sebastian Schuberth"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"299121","messageId":"4ABB8562.60104@gmail.com","threadId":"43827","inReplyTo":null,"subject":"[PATCH 2/2] Make just opening the generated MSVC solution file not modify it","fromName":"Sebastian Schuberth","fromEmail":"sschuberth@gmail.com","sentAt":"2009-09-24T14:42:42Z","receivedAt":"2009-09-24T14:42:42Z","isPatch":true,"sender":{"key":"sschuberth@gmail.com","avatar":"https://avatars.githubusercontent.com/u/349154?v=4"},"body":" From 9a0d743e227872189b17afb0b5c69b15422a0eef Mon Sep 17 00:00:00 2001\nFrom: Sebastian Schuberth <sschuberth@gmail.com>\nDate: Thu, 24 Sep 2009 16:26:59 +0200\nSubject: [PATCH 2/2] Make just opening the generated MSVC solution file not modify it\n\nThe format of the generated MSVC solution file is fixed in a way that just\nopening it in Visual Studio and immediately closing it again without performing\nany modifications does not trigger a prompt to save the solution file. This\nbehavior was caused by several minor incompatibilities between the generated\nfile and what Visual Studio 2008 expected, so Visual Studio transparently fixed\nthe file format, marking it internally as modified.\n\nSigned-off-by: Sebastian Schuberth <sschuberth@gmail.com>\n---\n  contrib/buildsystems/Generators/Vcproj.pm |   42 +++++++---------------------\n  1 files changed, 11 insertions(+), 31 deletions(-)\n\ndiff --git a/contrib/buildsystems/Generators/Vcproj.pm b/contrib/buildsystems/Generators/Vcproj.pm\nindex 50daa03..d53ff2c 100644\n--- a/contrib/buildsystems/Generators/Vcproj.pm\n+++ b/contrib/buildsystems/Generators/Vcproj.pm\n@@ -571,45 +571,29 @@ sub createGlueProject {\n          print F \"\\\"${libname}\\\", \\\"${libname}\\\\${libname}.vcproj\\\", \\\"${uuid}\\\"\";\n          print F \"$SLN_POST\";\n      }\n+    my $uuid_libgit = $build_structure{\"LIBS_libgit_GUID\"};\n+    my $uuid_xdiff_lib = $build_structure{\"LIBS_xdiff_lib_GUID\"};\n      foreach (@apps) {\n          my $appname = $_;\n          my $uuid = $build_structure{\"APPS_${appname}_GUID\"};\n          print F \"$SLN_PRE\";\n-        print F \"\\\"${appname}\\\", \\\"${appname}\\\\${appname}.vcproj\\\", \\\"${uuid}\\\"\";\n+        print F \"\\\"${appname}\\\", \\\"${appname}\\\\${appname}.vcproj\\\", \\\"${uuid}\\\"\\n\";\n+        print F \"\tProjectSection(ProjectDependencies) = postProject\\n\";\n+        print F \"\t\t${uuid_libgit} = ${uuid_libgit}\\n\";\n+        print F \"\t\t${uuid_xdiff_lib} = ${uuid_xdiff_lib}\\n\";\n+        print F \"\tEndProjectSection\";\n          print F \"$SLN_POST\";\n      }\n  \n      print F << \"EOM\";\n  Global\n-\tGlobalSection(SolutionConfiguration) = preSolution\n-\t\tConfigName.0 = Debug|Win32\n-\t\tConfigName.1 = Release|Win32\n+\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n+\t\tDebug|Win32 = Debug|Win32\n+\t\tRelease|Win32 = Release|Win32\n  \tEndGlobalSection\n-\tGlobalSection(ProjectDependencies) = postSolution\n  EOM\n-    foreach (@{$build_structure{\"APPS\"}}) {\n-        my $appname = $_;\n-        my $appname_clean = $_;\n-        $appname_clean =~ s/\\//_/g;\n-        $appname_clean =~ s/\\.exe//;\n-\n-        my $uuid = $build_structure{\"APPS_${appname_clean}_GUID\"};\n-        my $dep_index = 0;\n-        foreach(@{$build_structure{\"APPS_${appname}_LIBS\"}}) {\n-            my $libname = $_;\n-            $libname =~ s/\\//_/g;\n-            $libname =~ s/\\.(a|lib)//;\n-            my $libuuid = $build_structure{\"LIBS_${libname}_GUID\"};\n-            if (defined $libuuid) {\n-                print F \"\\t\\t${uuid}.${dep_index} = ${libuuid}\\n\";\n-                $dep_index += 1;\n-            }\n-        }\n-    }\n-\n      print F << \"EOM\";\n-\tEndGlobalSection\n-\tGlobalSection(ProjectConfiguration) = postSolution\n+\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n  EOM\n      foreach (@libs) {\n          my $libname = $_;\n@@ -630,10 +614,6 @@ EOM\n  \n      print F << \"EOM\";\n  \tEndGlobalSection\n-\tGlobalSection(ExtensibilityGlobals) = postSolution\n-\tEndGlobalSection\n-\tGlobalSection(ExtensibilityAddIns) = postSolution\n-\tEndGlobalSection\n  EndGlobal\n  EOM\n      close F;\n-- \n1.6.4.msysgit.0\n\n\n"}]}