summaryrefslogtreecommitdiff
path: root/infrastructure
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2011-04-08 20:40:33 +0000
committerChris Wilson <chris+github@qwirx.com>2011-04-08 20:40:33 +0000
commit36c6a2a6ba56c608dedf7b974717fb257bb7a8e0 (patch)
tree5f955a98e964a3bbd1fb2894146b1eec546a9d2c /infrastructure
parente781efb4d798c8b9c89c4969c21d6f8b0518f7f8 (diff)
Avoid unnecessary rewriting of BoxVersion.h to speed up MSVC build.
Diffstat (limited to 'infrastructure')
-rw-r--r--infrastructure/msvc/getversion.pl14
1 files changed, 12 insertions, 2 deletions
diff --git a/infrastructure/msvc/getversion.pl b/infrastructure/msvc/getversion.pl
index 12554d01..406501c6 100644
--- a/infrastructure/msvc/getversion.pl
+++ b/infrastructure/msvc/getversion.pl
@@ -11,9 +11,19 @@ chdir $basedir or die "$basedir: $!";
require "$basedir\\infrastructure\\BoxPlatform.pm.in";
-open VERSIONFILE, "> $basedir/lib/common/BoxVersion.h"
+my $newver = "#define BOX_VERSION \"$BoxPlatform::product_version\"\n";
+
+open VERSIONFILE, "< $basedir/lib/common/BoxVersion.h"
or die "BoxVersion.h: $!";
-print VERSIONFILE "#define BOX_VERSION \"$BoxPlatform::product_version\"\n";
+my $oldver = <VERSIONFILE>;
close VERSIONFILE;
+if ($newver ne $oldver)
+{
+ open VERSIONFILE, "> $basedir/lib/common/BoxVersion.h"
+ or die "BoxVersion.h: $!";
+ print VERSIONFILE "#define BOX_VERSION \"$BoxPlatform::product_version\"\n";
+ close VERSIONFILE;
+}
+
exit 0;