From: Stefan Reinauer Date: Tue, 7 Jul 2026 03:20:50 +0000 (-0700) Subject: qt: show beta version and build date in About X-Git-Url: https://gitweb.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=cd8ac825939829f5aa3a9f9c07df8a504372d672;p=francis%2Fwinuae.git qt: show beta version and build date in About Mirror upstream's effective WINUAEPUBLICBETA/WINUAEBETA values in od-unix/target.h and render the About version string in the same format as the Windows makeverstr(): "WinUAE 6.1.0 (Public Beta 9, 2026.07.06) ARM64". A configure-time check compares the mirror against od-win32/win32.h and fails with the exact values when an upstream rebase bumps the beta, so the mirror cannot silently drift. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index b09afc15..a49a291a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -256,6 +256,38 @@ foreach(WINUAE_UNIX_VERSION_LINE IN LISTS WINUAE_UNIX_VERSION_LINES) endforeach() set(WINUAE_UNIX_VERSION "${WINUAE_UNIX_VERSION_MAJOR}.${WINUAE_UNIX_VERSION_MINOR}.${WINUAE_UNIX_VERSION_REVISION}") +# od-unix/target.h mirrors the beta versioning from od-win32/win32.h; fail the +# configure when the mirror drifts after an upstream rebase. +set(WINUAE_WIN32_PUBLICBETA 0) +set(WINUAE_WIN32_BETA "") +set(WINUAE_UNIX_PUBLICBETA 0) +set(WINUAE_UNIX_BETA "") +file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/od-win32/win32.h" WINUAE_WIN32_BETA_LINES REGEX "^#define[ \t]+WINUAE(PUBLIC)?BETA[ \t]+") +foreach(WINUAE_BETA_LINE IN LISTS WINUAE_WIN32_BETA_LINES) + if(WINUAE_BETA_LINE MATCHES "WINUAEPUBLICBETA[ \t]+([0-9]+)") + set(WINUAE_WIN32_PUBLICBETA "${CMAKE_MATCH_1}") + elseif(NOT WINUAE_WIN32_BETA_FOUND AND WINUAE_BETA_LINE MATCHES "WINUAEBETA[ \t]+_T\\(\"([^\"]*)\"\\)") + # First match is the #if WINUAEPUBLICBETA branch; the #else branch is always empty. + set(WINUAE_WIN32_BETA "${CMAKE_MATCH_1}") + set(WINUAE_WIN32_BETA_FOUND TRUE) + endif() +endforeach() +if(WINUAE_WIN32_PUBLICBETA EQUAL 0) + set(WINUAE_WIN32_BETA "") +endif() +file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/od-unix/target.h" WINUAE_UNIX_BETA_LINES REGEX "^#define[ \t]+WINUAE(PUBLIC)?BETA[ \t]+") +foreach(WINUAE_BETA_LINE IN LISTS WINUAE_UNIX_BETA_LINES) + if(WINUAE_BETA_LINE MATCHES "WINUAEPUBLICBETA[ \t]+([0-9]+)") + set(WINUAE_UNIX_PUBLICBETA "${CMAKE_MATCH_1}") + elseif(WINUAE_BETA_LINE MATCHES "WINUAEBETA[ \t]+\"([^\"]*)\"") + set(WINUAE_UNIX_BETA "${CMAKE_MATCH_1}") + endif() +endforeach() +if(NOT WINUAE_UNIX_PUBLICBETA STREQUAL WINUAE_WIN32_PUBLICBETA OR NOT WINUAE_UNIX_BETA STREQUAL WINUAE_WIN32_BETA) + message(FATAL_ERROR "od-unix/target.h beta mismatch: WINUAEPUBLICBETA=${WINUAE_UNIX_PUBLICBETA} WINUAEBETA=\"${WINUAE_UNIX_BETA}\" vs od-win32/win32.h WINUAEPUBLICBETA=${WINUAE_WIN32_PUBLICBETA} WINUAEBETA=\"${WINUAE_WIN32_BETA}\". Update the mirror block in od-unix/target.h.") +endif() +set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS od-win32/win32.h od-unix/target.h) + find_package(ZLIB REQUIRED) if(WINUAE_UNIX_WITH_LIBPNG) if(APPLE AND CMAKE_PREFIX_PATH) diff --git a/od-unix/qt/launcher.cpp b/od-unix/qt/launcher.cpp index 387ac6d9..924cecc8 100644 --- a/od-unix/qt/launcher.cpp +++ b/od-unix/qt/launcher.cpp @@ -37,6 +37,8 @@ #include "launcher.h" #include "mount_config.h" #include "path_utils.h" +#include "target.h" +#include "winuae_builddate.h" #ifndef WINUAE_UNIX_SOURCE_DIR #define WINUAE_UNIX_SOURCE_DIR "." @@ -2255,10 +2257,31 @@ static QString resourceFile(const QString &relative) static QString versionString() { - return QStringLiteral("WinUAE %1.%2.%3") + QString s = QStringLiteral("WinUAE %1.%2.%3") .arg(WINUAE_UNIX_VERSION_MAJOR) .arg(WINUAE_UNIX_VERSION_MINOR) .arg(WINUAE_UNIX_VERSION_REVISION); + const QString date = QStringLiteral("%1.%2.%3") + .arg(GETBDY(WINUAEDATE)) + .arg(GETBDM(WINUAEDATE), 2, 10, QLatin1Char('0')) + .arg(GETBDD(WINUAEDATE), 2, 10, QLatin1Char('0')); + const QString beta = QStringLiteral(WINUAEBETA); + if (!beta.isEmpty()) { + if (WINUAEPUBLICBETA == 2) { + s += QStringLiteral(" (DevAlpha %1, %2)").arg(beta, date); + } else { + s += QStringLiteral(" (%1Beta %2, %3)") + .arg(WINUAEPUBLICBETA > 0 ? QStringLiteral("Public ") : QString(), beta, date); + } + } else { + s += QStringLiteral(" (%1)").arg(date); + } +#if defined(__aarch64__) + s += QStringLiteral(" ARM64"); +#elif defined(__x86_64__) + s += QStringLiteral(" x64"); +#endif + return s; } static QStringList contributorLines() diff --git a/od-unix/target.h b/od-unix/target.h index b9d4565c..bc198406 100644 --- a/od-unix/target.h +++ b/od-unix/target.h @@ -4,6 +4,12 @@ #define TARGET_NAME _T("unix") #define OPTIONSFILENAME _T("default.uae") +/* Effective beta versioning mirrored from od-win32/win32.h (WINUAEBETA is + * empty when upstream is not in a beta cycle). CMake fails the configure + * when these drift from win32.h after an upstream rebase. */ +#define WINUAEPUBLICBETA 1 +#define WINUAEBETA "9" + #define TARGET_ROM_PATH _T("~/") #define TARGET_FLOPPY_PATH _T("~/") #define TARGET_HARDFILE_PATH _T("~/")