bin: always define MESA_GIT_SHA1 to make it directly usable in code
authorEric Engestrom <eric.engestrom@intel.com>
Tue, 14 Aug 2018 17:04:58 +0000 (18:04 +0100)
committerEric Engestrom <eric.engestrom@intel.com>
Thu, 16 Aug 2018 16:38:31 +0000 (17:38 +0100)
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
bin/git_sha1_gen.py
src/gallium/drivers/svga/svga_screen.c
src/gallium/state_trackers/clover/api/device.cpp
src/gallium/state_trackers/clover/api/platform.cpp
src/mesa/main/context.c
src/mesa/main/version.c

index c6240662df3f6146a57f82e7a1a084473bff9e9e..7741159816b66ebae822551c353053cf3af0d1c1 100755 (executable)
@@ -47,6 +47,6 @@ args = parser.parse_args()
 
 git_sha1 = os.environ.get('MESA_GIT_SHA1_OVERRIDE', get_git_sha1())[:10]
 if git_sha1:
-    write_if_different('#define MESA_GIT_SHA1 "git-' + git_sha1 + '"')
+    write_if_different('#define MESA_GIT_SHA1 " (git-' + git_sha1 + ')"')
 else:
-    write_if_different('')
+    write_if_different('#define MESA_GIT_SHA1 ""')
index b8f936ee96730d97c57029dfd160bb8ef6361555..2a8825774623ea8d27451d5f1726b99ecb6b5fe3 100644 (file)
@@ -889,11 +889,7 @@ init_logging(struct pipe_screen *screen)
    svga_host_log(host_log);
 
    util_snprintf(host_log, sizeof(host_log) - strlen(log_prefix),
-                 "%s%s"
-#ifdef MESA_GIT_SHA1
-                 " (" MESA_GIT_SHA1 ")"
-#endif
-                 , log_prefix, PACKAGE_VERSION);
+                 "%s%s" MESA_GIT_SHA1, log_prefix, PACKAGE_VERSION);
    svga_host_log(host_log);
 
    /* If the SVGA_EXTRA_LOGGING env var is set, log the process's command
index 3572bb0c921f83ee9411c290012988c3433fdb5d..5a4f94c114143a4d1dc0b7ca652fcbf78ffee239 100644 (file)
@@ -322,11 +322,7 @@ clGetDeviceInfo(cl_device_id d_dev, cl_device_info param,
       break;
 
    case CL_DEVICE_VERSION:
-      buf.as_string() = "OpenCL " + dev.device_version() + " Mesa " PACKAGE_VERSION
-#ifdef MESA_GIT_SHA1
-                        " (" MESA_GIT_SHA1 ")"
-#endif
-                       ;
+      buf.as_string() = "OpenCL " + dev.device_version() + " Mesa " PACKAGE_VERSION MESA_GIT_SHA1;
       break;
 
    case CL_DEVICE_EXTENSIONS:
index 3b96b03fde81083e0d04c916f246edeae0df7fd9..fddbbecaa5927db6300a8851b81d67a63ffbc3e6 100644 (file)
@@ -62,11 +62,7 @@ clover::GetPlatformInfo(cl_platform_id d_platform, cl_platform_info param,
       static const std::string version_string =
             debug_get_option("CLOVER_PLATFORM_VERSION_OVERRIDE", "1.1");
 
-      buf.as_string() = "OpenCL " + version_string + " Mesa " PACKAGE_VERSION
-#ifdef MESA_GIT_SHA1
-                        " (" MESA_GIT_SHA1 ")"
-#endif
-                        ;
+      buf.as_string() = "OpenCL " + version_string + " Mesa " PACKAGE_VERSION MESA_GIT_SHA1;
       break;
    }
    case CL_PLATFORM_NAME:
index 0ef8fe32a635e90d6adaa3366312d7e854311472..7eea60f12a00f81799d70036a75981d4fdc01200 100644 (file)
@@ -404,11 +404,7 @@ one_time_init( struct gl_context *ctx )
 
 #if defined(DEBUG)
       if (MESA_VERBOSE != 0) {
-         _mesa_debug(ctx, "Mesa " PACKAGE_VERSION " DEBUG build"
-#ifdef MESA_GIT_SHA1
-                     " (" MESA_GIT_SHA1 ")"
-#endif
-                     "\n");
+         _mesa_debug(ctx, "Mesa " PACKAGE_VERSION " DEBUG build" MESA_GIT_SHA1 "\n");
       }
 #endif
    }
index 9df8c11c740ca02e4b77eacd129781edb5ca16a3..77ff51b6d9e66ef43a6ca346681e47bc86e29345 100644 (file)
@@ -121,11 +121,7 @@ create_version_string(struct gl_context *ctx, const char *prefix)
    ctx->VersionString = malloc(max);
    if (ctx->VersionString) {
       _mesa_snprintf(ctx->VersionString, max,
-                    "%s%u.%u%s Mesa " PACKAGE_VERSION
-#ifdef MESA_GIT_SHA1
-                    " (" MESA_GIT_SHA1 ")"
-#endif
-                    ,
+                    "%s%u.%u%s Mesa " PACKAGE_VERSION MESA_GIT_SHA1,
                     prefix,
                     ctx->Version / 10, ctx->Version % 10,
                     (ctx->API == API_OPENGL_CORE) ? " (Core Profile)" :