summaryrefslogtreecommitdiff
path: root/src/tools/msvc/Solution.pm
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/msvc/Solution.pm')
-rw-r--r--src/tools/msvc/Solution.pm23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index a4681aff69f..52bb9f826f7 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -20,6 +20,7 @@ sub new
options => $options,
numver => '',
strver => '',
+ vcver => undef,
};
bless $self;
if ($options->{xml})
@@ -29,9 +30,31 @@ sub new
die "XML requires both XSLT and ICONV\n";
}
}
+
+ $self->DetermineToolVersions();
+
return $self;
}
+sub DetermineToolVersions
+{
+ my $self = shift;
+
+ # Determine version of vcbuild command, to set proper verison of visual studio
+ open(P,"vcbuild /? |") || die "vcbuild command not found";
+ my $line = <P>;
+ close(P);
+ if ($line !~ /^Microsoft \(R\) Visual C\+\+ Project Builder - Command Line Version (\d+)\.00\.\d+/)
+ {
+ die "Unable to determine vcbuild version from first line of output!";
+ }
+ if ($1 == 8) { $self->{vcver} = '8.00' }
+ elsif ($1 == 9) { $self->{vcver} = '9.00' }
+ else { die "Unsupported version of Visual Studio: $1" }
+ print "Detected Visual Studio version $self->{vcver}\n";
+}
+
+
# Return 1 if $oldfile is newer than $newfile, or if $newfile doesn't exist.
# Special case - if config.pl has changed, always return 1
sub IsNewer