add version overrides for builds.

This commit is contained in:
ITotalJustice
2025-09-19 19:43:38 +01:00
parent 7cd668efb7
commit 2bd84c8d5a
6 changed files with 13 additions and 6 deletions

3
.gitignore vendored
View File

@@ -27,3 +27,6 @@ out
usb_test/
__pycache__
usb_*.spec
CMakeUserPresets.json
build_patreon.sh

View File

@@ -58,7 +58,11 @@ execute_process(
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(sphaira_VERSION_HASH "${sphaira_VERSION} [${GIT_COMMIT}]")
if (DEFINED sphaira_VERSION_OVERRIDE)
set(sphaira_DISPLAY_VERSION "${sphaira_VERSION_OVERRIDE} [${GIT_COMMIT}]")
else()
set(sphaira_DISPLAY_VERSION "${sphaira_VERSION} [${GIT_COMMIT}]")
endif()
add_executable(sphaira
source/ui/menus/appstore.cpp
@@ -158,7 +162,7 @@ add_executable(sphaira
target_compile_definitions(sphaira PRIVATE
-DAPP_VERSION="${sphaira_VERSION}"
-DAPP_VERSION_HASH="${sphaira_VERSION_HASH}"
-DAPP_DISPLAY_VERSION="${sphaira_DISPLAY_VERSION}"
-DCURL_NO_OLDIES=1
-DDEV_BUILD=$<BOOL:${DEV_BUILD}>
-DZSTD_STATIC_LINKING_ONLY=1

View File

@@ -1552,7 +1552,7 @@ App::App(const char* argv0) {
if (App::GetLogEnable()) {
log_file_init();
log_write("hello world v%s\n", APP_VERSION_HASH);
log_write("hello world v%s\n", APP_DISPLAY_VERSION);
}
// anything that can be async loaded should be placed in here in order

View File

@@ -953,7 +953,7 @@ void FsView::ZipFiles(fs::FsPath zip_out) {
auto zfile = zipOpen2_64(zip_out, APPEND_STATUS_CREATE, nullptr, &file_func);
R_UNLESS(zfile, Result_ZipOpen2_64);
ON_SCOPE_EXIT(zipClose(zfile, "sphaira v" APP_VERSION_HASH));
ON_SCOPE_EXIT(zipClose(zfile, "sphaira v" APP_DISPLAY_VERSION));
const auto zip_add = [&](const fs::FsPath& file_path) -> Result {
// the file name needs to be relative to the current directory.

View File

@@ -276,7 +276,7 @@ MainMenu::MainMenu() {
std::make_pair(Button::START, Action{App::Exit}),
std::make_pair(Button::SELECT, Action{App::DisplayMenuOptions}),
std::make_pair(Button::Y, Action{"Menu"_i18n, [this](){
auto options = std::make_unique<Sidebar>("Menu Options"_i18n, "v" APP_VERSION_HASH, Sidebar::Side::LEFT);
auto options = std::make_unique<Sidebar>("Menu Options"_i18n, "v" APP_DISPLAY_VERSION, Sidebar::Side::LEFT);
ON_SCOPE_EXIT(App::Push(std::move(options)));
SidebarEntryArray::Items language_items;

View File

@@ -1037,7 +1037,7 @@ Result Menu::BackupSaveInternal(ProgressBox* pbox, const dump::DumpLocation& loc
{
auto zfile = zipOpen2_64(path, APPEND_STATUS_CREATE, nullptr, &file_func);
R_UNLESS(zfile, Result_ZipOpen2_64);
ON_SCOPE_EXIT(zipClose(zfile, "sphaira v" APP_VERSION_HASH));
ON_SCOPE_EXIT(zipClose(zfile, "sphaira v" APP_DISPLAY_VERSION));
// add save meta.
{