diff options
Diffstat (limited to 'source/creator')
-rw-r--r-- | source/creator/CMakeLists.txt | 4 | ||||
-rw-r--r-- | source/creator/buildinfo.c | 4 | ||||
-rw-r--r-- | source/creator/creator.c | 27 |
3 files changed, 26 insertions, 9 deletions
diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt index 8e0ba6684ab..33d5c7dc90b 100644 --- a/source/creator/CMakeLists.txt +++ b/source/creator/CMakeLists.txt @@ -131,7 +131,9 @@ if(WITH_BUILDINFO) # # define in header now, else these get out of date on rebuilds. # -DBUILD_DATE="${BUILD_DATE}" # -DBUILD_TIME="${BUILD_TIME}" - # -DBUILD_REV="${BUILD_REV}" + # -DBUILD_CHANGE="${BUILD_CHANGE}" + # -DBUILD_HASH="${BUILD_HASH}" + # -DBUILD_BRANCH="${BUILD_BRANCH}" -DWITH_BUILDINFO_HEADER # alternative to lines above -DBUILD_PLATFORM="${CMAKE_SYSTEM_NAME}" -DBUILD_TYPE="${CMAKE_BUILD_TYPE}" diff --git a/source/creator/buildinfo.c b/source/creator/buildinfo.c index d747fe8e1ff..d51249980a8 100644 --- a/source/creator/buildinfo.c +++ b/source/creator/buildinfo.c @@ -39,7 +39,9 @@ /* currently only these are defined in the header */ char build_date[] = BUILD_DATE; char build_time[] = BUILD_TIME; -char build_rev[] = BUILD_REV; +char build_hash[] = BUILD_HASH; +char build_change[] = BUILD_CHANGE; +char build_branch[] = BUILD_BRANCH; char build_platform[] = BUILD_PLATFORM; char build_type[] = BUILD_TYPE; diff --git a/source/creator/creator.c b/source/creator/creator.c index 54fc80984f3..8221552a1d7 100644 --- a/source/creator/creator.c +++ b/source/creator/creator.c @@ -153,7 +153,9 @@ #ifdef BUILD_DATE extern char build_date[]; extern char build_time[]; -extern char build_rev[]; +extern char build_hash[]; +extern char build_change[]; +extern char build_branch[]; extern char build_platform[]; extern char build_type[]; extern char build_cflags[]; @@ -219,7 +221,14 @@ static int print_version(int UNUSED(argc), const char **UNUSED(argv), void *UNUS #ifdef BUILD_DATE printf("\tbuild date: %s\n", build_date); printf("\tbuild time: %s\n", build_time); - printf("\tbuild revision: %s\n", build_rev); + /* TODO(sergey): As soon as we fully switched to GIT, no need to check build_hash. */ + if (build_hash[0] != '\0') { + printf("\tbuild revision: %s\n", build_change); + } + else { + printf("\tbuild change: %s\n", build_change); + printf("\tbuild hash: %s\n", build_hash); + } printf("\tbuild platform: %s\n", build_platform); printf("\tbuild type: %s\n", build_type); printf("\tbuild c flags: %s\n", build_cflags); @@ -590,13 +599,17 @@ static void blender_crash_handler(int signum) printf("Writing: %s\n", fname); fflush(stdout); - BLI_snprintf(header, sizeof(header), "# " BLEND_VERSION_FMT ", Revision: %s\n", BLEND_VERSION_ARG, -#ifdef BUILD_DATE - build_rev +#ifndef BUILD_DATE + BLI_snprintf(header, sizeof(header), "# " BLEND_VERSION_FMT ", Unknown revision\n", BLEND_VERSION_ARG); #else - "Unknown" + /* TODO(sergey): As soon as we fully switched to GIT, no need to check build_hash. */ + if (build_hash[0] != '\0') { + BLI_snprintf(header, sizeof(header), "# " BLEND_VERSION_FMT ", Change: %s, Hash %s\n", BLEND_VERSION_ARG, build_change, build_hash); + } + else { + BLI_snprintf(header, sizeof(header), "# " BLEND_VERSION_FMT ", Revision: %s\n", BLEND_VERSION_ARG, build_change); + } #endif - ); /* open the crash log */ errno = 0; |