Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f28c2b3

Browse files
committed
Generation of commit_id.h for windows build
1 parent c64c94a commit f28c2b3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/tools/msvc/Solution.pm

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,22 @@ EOF
503503
last;
504504
}
505505
}
506+
# Generate commit_id file
507+
# If there is .git rewrite file whenever gitlog succeeds
508+
if ( -d ".git" ) {
509+
open P,"git log -1 --format='%h' |";
510+
my $commit_id = <P>;
511+
if (close(P)) {
512+
open(O, ">src/include/commit_id.h");
513+
print O "#define COMMIT_ID \"$commit_id\"\n";
514+
close O;
515+
}
516+
} elsif (! -f "src/include/commit_id.h" ) {
517+
# Otheriwse write file only if it not exists
518+
open(O, ">src/include/commit_id.h");
519+
print O "#define COMMIT_ID \"00000000\"\n";
520+
close O;
521+
}
506522

507523
open(O, ">doc/src/sgml/version.sgml")
508524
|| croak "Could not write to version.sgml\n";

0 commit comments

Comments
 (0)