This commit is contained in:
OatmealDome
2024-06-30 10:40:58 -04:00
parent 21e8c982d1
commit 96308266a2
2 changed files with 7 additions and 41 deletions

View File

@@ -22,17 +22,16 @@ if(GIT_FOUND)
execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} rev-list --count HEAD ^master
OUTPUT_VARIABLE DOLPHIN_WC_COMMITS_AHEAD_MASTER
OUTPUT_STRIP_TRAILING_WHITESPACE)
# defines DOLPHIN_WC_TAG
execute_process(WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${GIT_EXECUTABLE} describe --exact-match HEAD
OUTPUT_VARIABLE DOLPHIN_WC_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
# version number
set(DOLPHIN_VERSION_MAJOR "2407")
set(DOLPHIN_VERSION_MINOR "1")
set(DOLPHIN_VERSION_PATCH ${DOLPHIN_WC_REVISION})
set(DOLPHIN_VERSION_MAJOR "5")
set(DOLPHIN_VERSION_MINOR "0")
if(DOLPHIN_WC_BRANCH STREQUAL "stable")
set(DOLPHIN_VERSION_PATCH "0")
else()
set(DOLPHIN_VERSION_PATCH ${DOLPHIN_WC_REVISION})
endif()
# If Dolphin is not built from a Git repository, default the version info to
# reasonable values.
@@ -43,13 +42,6 @@ if(NOT DOLPHIN_WC_REVISION)
set(DOLPHIN_WC_COMMITS_AHEAD_MASTER 0)
endif()
# If this is a tag (i.e. a release), then set the current patch version and
# the number of commits ahead to zero.
if(DOLPHIN_WC_TAG)
set(DOLPHIN_VERSION_PATCH "0")
set(DOLPHIN_WC_COMMITS_AHEAD_MASTER 0)
endif()
function(configure_source_file path)
configure_file(
"${PROJECT_SOURCE_DIR}/${path}.in"

View File

@@ -6,7 +6,6 @@ var cmd_revision = " rev-parse HEAD";
var cmd_describe = " describe --always --long --dirty";
var cmd_branch = " rev-parse --abbrev-ref HEAD";
var cmd_commits_ahead = " rev-list --count HEAD ^master";
var cmd_get_tag = " describe --exact-match HEAD";
function GetGitExe()
{
@@ -60,25 +59,6 @@ function GetFirstStdOutLine(cmd)
}
}
function AttemptToExecuteCommand(cmd)
{
try
{
var exec = wshShell.Exec(cmd)
// wait until the command has finished
while (exec.Status == 0) {}
return exec.ExitCode;
}
catch (e)
{
// catch "the system cannot find the file specified" error
WScript.Echo("Failed to exec " + cmd + " this should never happen");
WScript.Quit(1);
}
}
function GetFileContents(f)
{
try
@@ -108,12 +88,6 @@ if (default_update_track == "%DOLPHIN_DEFAULT_UPDATE_TRACK%") default_update_tra
// remove hash (and trailing "-0" if needed) from description
describe = describe.replace(/(-0)?-[^-]+(-dirty)?$/, '$2');
// set commits ahead to zero if on a tag
if (AttemptToExecuteCommand(gitexe + cmd_get_tag) == 0)
{
commits_ahead = "0";
}
var out_contents =
"#define SCM_REV_STR \"" + revision + "\"\n" +
"#define SCM_DESC_STR \"" + describe + "\"\n" +