Commit 0725c1ed by Jamie Madill Committed by Commit Bot

Add ANGLE commit position to version.h.

Bug: b/168736059 Change-Id: If35210cfc91781cab6f40a1f03a4e82ada90690f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2425196 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 617d92a3
......@@ -43,12 +43,14 @@ output_file = sys.argv[2]
commit_id_size = 12
commit_id = 'unknown hash'
commit_date = 'unknown date'
commit_position = '0'
enable_binary_loading = False
if git_dir_exists:
try:
commit_id = grab_output('git rev-parse --short=%d HEAD' % commit_id_size, cwd)
commit_date = grab_output('git show -s --format=%ci HEAD', cwd)
commit_position = grab_output('git rev-list HEAD --count', cwd)
enable_binary_loading = True
except:
pass
......@@ -58,6 +60,7 @@ hfile = open(output_file, 'w')
hfile.write('#define ANGLE_COMMIT_HASH "%s"\n' % commit_id)
hfile.write('#define ANGLE_COMMIT_HASH_SIZE %d\n' % commit_id_size)
hfile.write('#define ANGLE_COMMIT_DATE "%s"\n' % commit_date)
hfile.write('#define ANGLE_COMMIT_POSITION %s\n' % commit_position)
if not enable_binary_loading:
hfile.write('#define ANGLE_DISABLE_PROGRAM_BINARY_LOAD\n')
......
......@@ -13,7 +13,7 @@
#define ANGLE_MINOR_VERSION 1
#ifndef ANGLE_REVISION
# define ANGLE_REVISION 0
# define ANGLE_REVISION ANGLE_COMMIT_POSITION
#endif
#define ANGLE_STRINGIFY(x) #x
......@@ -22,6 +22,6 @@
#define ANGLE_VERSION_STRING \
ANGLE_MACRO_STRINGIFY(ANGLE_MAJOR_VERSION) \
"." ANGLE_MACRO_STRINGIFY(ANGLE_MINOR_VERSION) "." ANGLE_MACRO_STRINGIFY( \
ANGLE_REVISION) "." ANGLE_COMMIT_HASH
ANGLE_REVISION) " git hash: " ANGLE_COMMIT_HASH
#endif // COMMON_VERSION_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment