mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-11-14 13:35:07 -05:00
Change the branch criteria to not having a tag
This commit is contained in:
parent
31db01be19
commit
7c79fbd41f
@ -27,6 +27,19 @@ execute_process(
|
||||
|
||||
set(CMAKE_PROJECT_GIT_COMMIT_HASH "${GIT_COMMIT_HASH}" CACHE STRING "Git commit hash" FORCE)
|
||||
|
||||
execute_process(
|
||||
COMMAND git describe --tags --abbrev=0 --exact-match HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_COMMIT_TAG
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
|
||||
if(NOT GIT_COMMIT_TAG)
|
||||
set(GIT_COMMIT_TAG "" CACHE STRING "Git commit tag" FORCE)
|
||||
endif()
|
||||
|
||||
set(CMAKE_PROJECT_GIT_COMMIT_TAG "${GIT_COMMIT_TAG}" CACHE STRING "Git commit tag" FORCE)
|
||||
|
||||
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT soh)
|
||||
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MP>)
|
||||
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/utf-8>)
|
||||
|
@ -51,6 +51,7 @@ extern "C"
|
||||
extern u16 gBuildVersionPatch;
|
||||
extern u8 gGitBranch[];
|
||||
extern u8 gGitCommitHash[];
|
||||
extern u8 gGitCommitTag[];
|
||||
extern u8 gBuildTeam[];
|
||||
extern u8 gBuildDate[];
|
||||
extern u8 gBuildMakeOption[];
|
||||
|
@ -437,8 +437,8 @@ void DrawGameplayStatsHeader() {
|
||||
ImGui::BeginTable("gameplayStatsHeader", 1, ImGuiTableFlags_BordersOuter);
|
||||
ImGui::TableSetupColumn("stat", ImGuiTableColumnFlags_WidthStretch);
|
||||
GameplayStatsRow("Build Version:", (char*)gBuildVersion);
|
||||
//if branch doesn't start with "develop"
|
||||
if (strncmp((char*)gGitBranch, "develop", strlen("develop")) != 0) {
|
||||
//if tag is empty (not a release build)
|
||||
if (gGitCommitTag[0] == 0) {
|
||||
GameplayStatsRow("Git Branch:", (char*)gGitBranch);
|
||||
}
|
||||
if (CVarGetInteger("gGameplayStats.ShowDebugInfo", 0)) {
|
||||
|
@ -6,6 +6,7 @@ const u16 gBuildVersionMinor = @CMAKE_PROJECT_VERSION_MINOR@;
|
||||
const u16 gBuildVersionPatch = @CMAKE_PROJECT_VERSION_PATCH@;
|
||||
const char gGitBranch[] = "@CMAKE_PROJECT_GIT_BRANCH@";
|
||||
const char gGitCommitHash[] = "@CMAKE_PROJECT_GIT_COMMIT_HASH@";
|
||||
const char gGitCommitTag[] = "@CMAKE_PROJECT_GIT_COMMIT_TAG@";
|
||||
const char gBuildTeam[] = "@PROJECT_TEAM@";
|
||||
const char gBuildDate[] = __DATE__ " " __TIME__;
|
||||
const char gBuildMakeOption[] = "";
|
||||
|
@ -31,8 +31,8 @@ void Title_PrintBuildInfo(Gfx** gfxp) {
|
||||
GfxPrint_Open(&printer, g);
|
||||
GfxPrint_SetColor(&printer, 131, 154, 255, 255);
|
||||
|
||||
//if branch doesn't start with "develop"
|
||||
bool showGitBranch = strncmp((char*)gGitBranch, "develop", strlen("develop")) != 0;
|
||||
//if tag is empty (not a release build)
|
||||
bool showGitBranch = gGitCommitTag[0] == 0;
|
||||
bool showGitCommit = CVarGetInteger("gDebugEnabled", 0);
|
||||
|
||||
GfxPrint_SetPos(&printer, 1, showGitBranch ? (showGitCommit ? 23 : 24) : (showGitCommit ? 24 : 25));
|
||||
|
Loading…
Reference in New Issue
Block a user