Revamp version tagging, remove ugly suffix on git hash. Refs #571

* Tacking -official onto the git hash was a hack only needed on windows,
  and since we want more information it doesn't scale.
* Instead we track anything we need to know about the version in
  separate variables, like whether it's a stable build or a nightly/
  local build. Or if it's built by a downstream distribution then the
  version number for the downstream build.
This commit is contained in:
baldurk committed 2017-04-27 19:47:50 +01:00
1 parent 4199a857f5
commit ae50fa99ee
17 files changed
+213 -106

No files matched your search

-6
View File
@@ -7,12 +7,6 @@ set(RDOC_INCLUDES
PRIVATE ${RDOC_SOURCE_DIR}/3rdparty)
set(RDOC_LIBRARIES)
# get git commit hash
get_git_hash(GIT_COMMIT_HASH)
string(STRIP ${GIT_COMMIT_HASH} GIT_COMMIT_HASH)
list(APPEND RDOC_DEFINITIONS
PRIVATE -DGIT_COMMIT_HASH="${GIT_COMMIT_HASH}")
if(ANDROID)
list(APPEND RDOC_LIBRARIES
PRIVATE m
-11
View File
@@ -1403,17 +1403,6 @@ This will be in the form "MAJOR.MINOR"
)");
extern "C" RENDERDOC_API const char *RENDERDOC_CC RENDERDOC_GetVersionString();
DOCUMENT(R"(Retrieves the git commit hash string.
This will be in the form ``61262f...fa-versionstring`` where the ``-versionstring`` suffix is
specific to the particular build and may take many values. A common one is ``-official`` for binary
releases generated upstream.
:return: The commit string.
:rtype: ``str``
)");
extern "C" RENDERDOC_API const char *RENDERDOC_CC RENDERDOC_GetCommitHash();
DOCUMENT("Internal function for retrieving a config setting.");
extern "C" RENDERDOC_API const char *RENDERDOC_CC RENDERDOC_GetConfigSetting(const char *name);
+83 -10
View File
@@ -24,16 +24,89 @@
#pragma once
#define VER_STR2(a) #a
#define VER_STR(a) VER_STR2(a)
///////////////////////////////////////////////////////////////////////////////////////
//
// Build configuration variables.
//
// When distributing RenderDoc builds please check these variables before building and
// set them appropriately. If you're building locally, the defaults are all fine.
//
// For windows builds, some of these variables are irrelevant and can be ignored.
//
// For non-windows builds, these variables have cmake settings that you can use to set
// them, and are designed to be set that way. See BUILD_VERSION_*.
//
// However if you want to you can locally modify this file (e.g. copy a file with some fixed values
// set, then just update the version numbers in the build process).
//
#define RENDERDOC_VERSION_MAJOR 0
#define RENDERDOC_VERSION_MINOR 34
#define RENDERDOC_VERSION_STRING \
VER_STR(RENDERDOC_VERSION_MAJOR) "." VER_STR(RENDERDOC_VERSION_MINOR)
#if defined(GIT_COMMIT_HASH_LITERAL)
#define GIT_COMMIT_HASH VER_STR(GIT_COMMIT_HASH_LITERAL)
#elif !defined(GIT_COMMIT_HASH)
// This should be set to the last upstream git commit where the build comes from. If any later
// commits are cherry-picked or local patches are applied, this should still point to the hash of
// the tree that the build was based on.
//
// Windows users can run ./scripts/hash_version.sh from the root of the checkout to set this, anyone
// else should set BUILD_VERSION_HASH in the cmake build command.
#if !defined(GIT_COMMIT_HASH)
#define GIT_COMMIT_HASH "NO_GIT_COMMIT_HASH_DEFINED"
#endif
// If this variable is set to 1, then this build is considered a stable version - based on a tagged
// version number upstream, possibly with some patches applied as necessary.
// Any other build whether it's including experimental local changes or just from the tip of the
// latest code at some other point should be considered unstable and leave this as 0.
#if !defined(RENDERDOC_STABLE_BUILD)
#define RENDERDOC_STABLE_BUILD 0
#endif
///////////////////////////////////////////////////////////////////////////////////////
//
// If you are distributing to the public, you should set values for these variables below.
//
// The friendly name of the distribution that packaged this build
#if !defined(DISTRIBUTION_NAME)
//#define DISTRIBUTION_NAME "DistributionName"
#endif
// An arbitrary distribution version string. If set, this should include the major and minor
// version numbers in it.
#if !defined(DISTRIBUTION_VERSION)
//#define DISTRIBUTION_VERSION "MAJ.MIN-foo.4b"
#endif
// Set to an URL or email of who produced this build and should be the first point of contact for
// any issues.
// If you're distributing builds for the public then do update this to point to your bugtracker or
// similar.
#if !defined(DISTRIBUTION_CONTACT)
//#define DISTRIBUTION_CONTACT "https://distribution.example/packages/renderdoc"
#endif
///////////////////////////////////////////////////////////////////////////////////////
//
// Internal or derived variables
// You should NOT enable this variable. This is used by upstream builds to determine whether
// this is an official build e.g. that should send crash reports.
#define RENDERDOC_OFFICIAL_BUILD 0
// The major and minor version that describe this build. These numbers are modified linearly
// upstream and should not be modified downstream. You can set DISTRIBUTION_VERSION to include any
// arbitrary release marker or package version you wish.
#define RENDERDOC_VERSION_MAJOR 0
#define RENDERDOC_VERSION_MINOR 34
#define RDOC_INTERNAL_VERSION_STRINGIZE2(a) #a
#define RDOC_INTERNAL_VERSION_STRINGIZE(a) RDOC_INTERNAL_VERSION_STRINGIZE2(a)
// string that's just "major.minor"
#define MAJOR_MINOR_VERSION_STRING \
RDOC_INTERNAL_VERSION_STRINGIZE(RENDERDOC_VERSION_MAJOR) \
"." RDOC_INTERNAL_VERSION_STRINGIZE(RENDERDOC_VERSION_MINOR)
// string that's the actual version number, either from the distribution or just vX.Y
#if defined(DISTRIBUTION_VERSION)
#define FULL_VERSION_STRING "v" DISTRIBUTION_VERSION
#else
#define FULL_VERSION_STRING "v" MAJOR_MINOR_VERSION_STRING
#endif
+8 -6
View File
@@ -307,12 +307,14 @@ void RenderDoc::Initialise()
RDCLOGFILE(m_LoggingFilename.c_str());
}
if(IsReplayApp())
RDCLOG("RenderDoc v%s %s (%s) loaded in replay application", RENDERDOC_VERSION_STRING,
sizeof(uintptr_t) == sizeof(uint64_t) ? "x64" : "x86", GIT_COMMIT_HASH);
else
RDCLOG("RenderDoc v%s %s (%s) capturing application", RENDERDOC_VERSION_STRING,
sizeof(uintptr_t) == sizeof(uint64_t) ? "x64" : "x86", GIT_COMMIT_HASH);
RDCLOG("RenderDoc v%s %s %s (%s) %s", MAJOR_MINOR_VERSION_STRING,
sizeof(uintptr_t) == sizeof(uint64_t) ? "x64" : "x86",
ENABLED(RDOC_RELEASE) ? "Release" : "Development", GIT_COMMIT_HASH,
IsReplayApp() ? "loaded in replay application" : "capturing application");
#if defined(DISTRIBUTION_VERSION)
RDCLOG("Packaged for %s (%s) - %s", DISTRIBUTION_NAME, DISTRIBUTION_VERSION, DISTRIBUTION_CONTACT);
#endif
Keyboard::Init();
+2 -2
View File
@@ -23,7 +23,7 @@
* THE SOFTWARE.
******************************************************************************/
#if USE_BREAKPAD && defined(RENDERDOC_OFFICIAL_BUILD)
#if USE_BREAKPAD && RENDERDOC_OFFICIAL_BUILD
#define RDOC_CRASH_HANDLER OPTION_ON
@@ -108,7 +108,7 @@ public:
google_breakpad::CustomInfoEntry(L"gitcommit", L""),
};
wstring wideStr = StringFormat::UTF82Wide(string(RENDERDOC_VERSION_STRING));
wstring wideStr = StringFormat::UTF82Wide(string(MAJOR_MINOR_VERSION_STRING));
breakpadCustomInfo[0].set_value(wideStr.c_str());
wideStr = StringFormat::UTF82Wide(string(RDCGETLOGFILE()));
breakpadCustomInfo[1].set_value(wideStr.c_str());
+2 -2
View File
@@ -85,12 +85,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Baldur Karlsson"
VALUE "FileDescription", "Core DLL for RenderDoc - https://renderdoc.org/"
VALUE "FileVersion", RENDERDOC_VERSION_STRING ".0.0"
VALUE "FileVersion", MAJOR_MINOR_VERSION_STRING ".0.0"
VALUE "InternalName", "renderdoc.dll"
VALUE "LegalCopyright", "Copyright © 2016 Baldur Karlsson"
VALUE "OriginalFilename", "renderdoc.dll"
VALUE "ProductName", "RenderDoc"
VALUE "ProductVersion", RENDERDOC_VERSION_STRING "-" GIT_COMMIT_HASH
VALUE "ProductVersion", FULL_VERSION_STRING
END
END
BLOCK "VarFileInfo"
-2
View File
@@ -41,8 +41,6 @@
#define RESOURCE_glsl_depthms2arr_frag 427
#define RESOURCE_glsl_gles_texsample_h 428
//#define RENDERDOC_OFFICIAL_BUILD // used to determine whether to submit auto crash reports
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
+1 -6
View File
@@ -234,12 +234,7 @@ extern "C" RENDERDOC_API void RENDERDOC_CC Camera_GetBasis(Camera *c, FloatVecto
extern "C" RENDERDOC_API const char *RENDERDOC_CC RENDERDOC_GetVersionString()
{
return RENDERDOC_VERSION_STRING;
}
extern "C" RENDERDOC_API const char *RENDERDOC_CC RENDERDOC_GetCommitHash()
{
return GIT_COMMIT_HASH;
return MAJOR_MINOR_VERSION_STRING;
}
extern "C" RENDERDOC_API const char *RENDERDOC_CC RENDERDOC_GetConfigSetting(const char *name)