]> gitweb.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
qt: show beta version and build date in About
authorStefan Reinauer <stefan.reinauer@coreboot.org>
Tue, 7 Jul 2026 03:20:50 +0000 (20:20 -0700)
committerStefan Reinauer <stefan.reinauer@coreboot.org>
Tue, 7 Jul 2026 21:00:11 +0000 (14:00 -0700)
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.

CMakeLists.txt
od-unix/qt/launcher.cpp
od-unix/target.h

index b09afc1571fc4c1b579e1d252141fce1a24f1b69..a49a291aded04b1814de6aae6c3c6085122f9807 100644 (file)
@@ -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)
index 387ac6d94014fef318e810a6091c45dc2a47844a..924cecc8cec4e1f342b193d4777008d4117b43e9 100644 (file)
@@ -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()
index b9d4565ce0add2768455558d92f4a775436fc761..bc198406660b44a5cf49dc77cdc97a3f5df3c7c1 100644 (file)
@@ -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("~/")