Skip to content

Commit e0ab002

Browse files
sschuberthspearce
authored andcommitted
Make just opening the generated MSVC solution file not modify it
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 <[email protected]> Acked-by: Marius Storm-Olsen <[email protected]> Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent 76031f1 commit e0ab002

File tree

1 file changed

+11
-31
lines changed

1 file changed

+11
-31
lines changed

contrib/buildsystems/Generators/Vcproj.pm

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -571,45 +571,29 @@ sub createGlueProject {
571571
print F "\"${libname}\", \"${libname}\\${libname}.vcproj\", \"${uuid}\"";
572572
print F "$SLN_POST";
573573
}
574+
my $uuid_libgit = $build_structure{"LIBS_libgit_GUID"};
575+
my $uuid_xdiff_lib = $build_structure{"LIBS_xdiff_lib_GUID"};
574576
foreach (@apps) {
575577
my $appname = $_;
576578
my $uuid = $build_structure{"APPS_${appname}_GUID"};
577579
print F "$SLN_PRE";
578-
print F "\"${appname}\", \"${appname}\\${appname}.vcproj\", \"${uuid}\"";
580+
print F "\"${appname}\", \"${appname}\\${appname}.vcproj\", \"${uuid}\"\n";
581+
print F " ProjectSection(ProjectDependencies) = postProject\n";
582+
print F " ${uuid_libgit} = ${uuid_libgit}\n";
583+
print F " ${uuid_xdiff_lib} = ${uuid_xdiff_lib}\n";
584+
print F " EndProjectSection";
579585
print F "$SLN_POST";
580586
}
581587

582588
print F << "EOM";
583589
Global
584-
GlobalSection(SolutionConfiguration) = preSolution
585-
ConfigName.0 = Debug|Win32
586-
ConfigName.1 = Release|Win32
590+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
591+
Debug|Win32 = Debug|Win32
592+
Release|Win32 = Release|Win32
587593
EndGlobalSection
588-
GlobalSection(ProjectDependencies) = postSolution
589594
EOM
590-
foreach (@{$build_structure{"APPS"}}) {
591-
my $appname = $_;
592-
my $appname_clean = $_;
593-
$appname_clean =~ s/\//_/g;
594-
$appname_clean =~ s/\.exe//;
595-
596-
my $uuid = $build_structure{"APPS_${appname_clean}_GUID"};
597-
my $dep_index = 0;
598-
foreach(@{$build_structure{"APPS_${appname}_LIBS"}}) {
599-
my $libname = $_;
600-
$libname =~ s/\//_/g;
601-
$libname =~ s/\.(a|lib)//;
602-
my $libuuid = $build_structure{"LIBS_${libname}_GUID"};
603-
if (defined $libuuid) {
604-
print F "\t\t${uuid}.${dep_index} = ${libuuid}\n";
605-
$dep_index += 1;
606-
}
607-
}
608-
}
609-
610595
print F << "EOM";
611-
EndGlobalSection
612-
GlobalSection(ProjectConfiguration) = postSolution
596+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
613597
EOM
614598
foreach (@libs) {
615599
my $libname = $_;
@@ -630,10 +614,6 @@ EOM
630614

631615
print F << "EOM";
632616
EndGlobalSection
633-
GlobalSection(ExtensibilityGlobals) = postSolution
634-
EndGlobalSection
635-
GlobalSection(ExtensibilityAddIns) = postSolution
636-
EndGlobalSection
637617
EndGlobal
638618
EOM
639619
close F;

0 commit comments

Comments
 (0)