Ignore:
Timestamp:
08/04/2011 21:40:33 (14 months ago)
Author:
chris
Message:

Avoid unnecessary rewriting of BoxVersion?.h to speed up MSVC build.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/infrastructure/msvc/getversion.pl

    r1078 r2905  
    1212require "$basedir\\infrastructure\\BoxPlatform.pm.in"; 
    1313 
    14 open VERSIONFILE, "> $basedir/lib/common/BoxVersion.h"  
     14my $newver = "#define BOX_VERSION \"$BoxPlatform::product_version\"\n"; 
     15 
     16open VERSIONFILE, "< $basedir/lib/common/BoxVersion.h"  
    1517        or die "BoxVersion.h: $!"; 
    16 print VERSIONFILE "#define BOX_VERSION \"$BoxPlatform::product_version\"\n"; 
     18my $oldver = <VERSIONFILE>; 
    1719close VERSIONFILE; 
    1820 
     21if ($newver ne $oldver) 
     22{ 
     23        open VERSIONFILE, "> $basedir/lib/common/BoxVersion.h"  
     24                or die "BoxVersion.h: $!"; 
     25        print VERSIONFILE "#define BOX_VERSION \"$BoxPlatform::product_version\"\n"; 
     26        close VERSIONFILE; 
     27} 
     28 
    1929exit 0; 
Note: See TracChangeset for help on using the changeset viewer.