summaryrefslogtreecommitdiff
path: root/vs_postclean.pl
diff options
context:
space:
mode:
Diffstat (limited to 'vs_postclean.pl')
-rwxr-xr-xvs_postclean.pl7
1 files changed, 6 insertions, 1 deletions
diff --git a/vs_postclean.pl b/vs_postclean.pl
index 74c31410..90c3c696 100755
--- a/vs_postclean.pl
+++ b/vs_postclean.pl
@@ -85,6 +85,7 @@ sub clean_proj {
chdir($current_dir);
}
else {
+ ## We'll only warn about files that we can't deal with.
print "WARNING: Unable to postclean $file\n";
}
}
@@ -94,6 +95,7 @@ sub clean_sln {
my($cfg, $file) = @_;
my $fh = new FileHandle();
+ ## For a solution, just read in and clean each project file we find.
if (open($fh, $file)) {
while (<$fh>) {
if (/^Project\([^)]+\) = "[^\"]+", "([^\"]+)"/) {
@@ -114,6 +116,8 @@ if ($#ARGV == -1) {
exit(0);
}
+## Determine the project or solution configuration (defaulting to the
+## default created by MPC).
my $cfg = 'Debug|Win32';
if ($ARGV[0] =~ /^CFG=(.+)/) {
$cfg = $1;
@@ -121,10 +125,11 @@ if ($ARGV[0] =~ /^CFG=(.+)/) {
}
foreach my $file (@ARGV) {
- if (substr($file, -4, 4) eq '.sln') {
+ if ($file =~ /\.sln$/) {
clean_sln($cfg, $file);
}
else {
+ ## It's not a solution file, we'll assume it's a project
clean_proj($cfg, $file);
}
}