summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar SilverBeamx2020-04-07 22:41:45 +0200
committerGravatar SilverBeamx2020-04-07 22:41:45 +0200
commit6b512d78c994550ff653d519af7784023be5ebd2 (patch)
tree1036a2ce099a1c097e8dca9ab09bd3306e03e819
parentHack BUILD_FULLNAME into GenerateSCMRev.cmake (diff)
downloadyuzu-6b512d78c994550ff653d519af7784023be5ebd2.tar.gz
yuzu-6b512d78c994550ff653d519af7784023be5ebd2.tar.xz
yuzu-6b512d78c994550ff653d519af7784023be5ebd2.zip
Addressed feedback: removed CMake hack in favor of building the necessary strings via the supplied title format
-rw-r--r--CMakeModules/GenerateSCMRev.cmake21
-rw-r--r--src/yuzu/about_dialog.cpp8
-rw-r--r--src/yuzu/main.cpp8
3 files changed, 16 insertions, 21 deletions
diff --git a/CMakeModules/GenerateSCMRev.cmake b/CMakeModules/GenerateSCMRev.cmake
index 787e30df1..5d4eccb00 100644
--- a/CMakeModules/GenerateSCMRev.cmake
+++ b/CMakeModules/GenerateSCMRev.cmake
@@ -20,6 +20,8 @@ get_timestamp(BUILD_DATE)
20# Also if this is a CI build, add the build name (ie: Nightly, Canary) to the scm_rev file as well 20# Also if this is a CI build, add the build name (ie: Nightly, Canary) to the scm_rev file as well
21set(REPO_NAME "") 21set(REPO_NAME "")
22set(BUILD_VERSION "0") 22set(BUILD_VERSION "0")
23set(TITLE_BAR_FORMAT_IDLE "yuzu {5} ")
24set(BUILD_ID "420")
23if (BUILD_REPOSITORY) 25if (BUILD_REPOSITORY)
24 # regex capture the string nightly or canary into CMAKE_MATCH_1 26 # regex capture the string nightly or canary into CMAKE_MATCH_1
25 string(REGEX MATCH "yuzu-emu/yuzu-?(.*)" OUTVAR ${BUILD_REPOSITORY}) 27 string(REGEX MATCH "yuzu-emu/yuzu-?(.*)" OUTVAR ${BUILD_REPOSITORY})
@@ -48,25 +50,6 @@ if (BUILD_REPOSITORY)
48 endif() 50 endif()
49endif() 51endif()
50 52
51# "Hack": Generate BUILD_FULLNAME from the Git desc
52if (GIT_DESC)
53 # regex capture the characters before the first "-" into CMAKE_MATCH_1
54 string(REGEX MATCH "^([a-z]*)-.*" OUTVAR ${GIT_DESC})
55 if ("${CMAKE_MATCH_COUNT}" GREATER 0)
56 # capitalize the first letter of the repo name.
57 string(SUBSTRING ${CMAKE_MATCH_1} 0 1 FIRST_LETTER)
58 string(SUBSTRING ${CMAKE_MATCH_1} 1 -1 REMAINDER)
59 string(TOUPPER ${FIRST_LETTER} FIRST_LETTER)
60 set(REPO_NAME "${FIRST_LETTER}${REMAINDER}")
61
62 # If GIT_DESC has been parsed correctly, build the BUILD_FULLNAME from the repo name and the
63 # build version
64 if(REPO_NAME)
65 set(BUILD_FULLNAME "${REPO_NAME} ${BUILD_ID} ")
66 endif()
67 endif()
68endif()
69
70# The variable SRC_DIR must be passed into the script (since it uses the current build directory for all values of CMAKE_*_DIR) 53# The variable SRC_DIR must be passed into the script (since it uses the current build directory for all values of CMAKE_*_DIR)
71set(VIDEO_CORE "${SRC_DIR}/src/video_core") 54set(VIDEO_CORE "${SRC_DIR}/src/video_core")
72set(HASH_FILES 55set(HASH_FILES
diff --git a/src/yuzu/about_dialog.cpp b/src/yuzu/about_dialog.cpp
index d39b3f07a..e7985c8a7 100644
--- a/src/yuzu/about_dialog.cpp
+++ b/src/yuzu/about_dialog.cpp
@@ -3,15 +3,21 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <QIcon> 5#include <QIcon>
6#include <fmt/format.h>
6#include "common/scm_rev.h" 7#include "common/scm_rev.h"
7#include "ui_aboutdialog.h" 8#include "ui_aboutdialog.h"
8#include "yuzu/about_dialog.h" 9#include "yuzu/about_dialog.h"
9 10
10AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) { 11AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) {
12 const auto build_id = std::string(Common::g_build_id);
13 const auto fmt = std::string(Common::g_title_bar_format_idle);
14 const auto yuzuBuildVersion = fmt::format(fmt.empty() ? "yuzu Development Build" : fmt, std::string{}, std::string{},
15 std::string{}, std::string{}, std::string{}, build_id);
16
11 ui->setupUi(this); 17 ui->setupUi(this);
12 ui->labelLogo->setPixmap(QIcon::fromTheme(QStringLiteral("yuzu")).pixmap(200)); 18 ui->labelLogo->setPixmap(QIcon::fromTheme(QStringLiteral("yuzu")).pixmap(200));
13 ui->labelBuildInfo->setText(ui->labelBuildInfo->text().arg( 19 ui->labelBuildInfo->setText(ui->labelBuildInfo->text().arg(
14 QString::fromUtf8(Common::g_build_fullname), QString::fromUtf8(Common::g_scm_branch), 20 QString::fromStdString(yuzuBuildVersion), QString::fromUtf8(Common::g_scm_branch),
15 QString::fromUtf8(Common::g_scm_desc), QString::fromUtf8(Common::g_build_date).left(10))); 21 QString::fromUtf8(Common::g_scm_desc), QString::fromUtf8(Common::g_build_date).left(10)));
16} 22}
17 23
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 940f24dc8..5cefb5d72 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -205,7 +205,13 @@ GMainWindow::GMainWindow()
205 ConnectMenuEvents(); 205 ConnectMenuEvents();
206 ConnectWidgetEvents(); 206 ConnectWidgetEvents();
207 207
208 LOG_INFO(Frontend, "yuzu Version: {} | {}-{}", Common::g_build_fullname, Common::g_scm_branch, 208 const auto build_id = std::string(Common::g_build_id);
209 const auto fmt = std::string(Common::g_title_bar_format_idle);
210 const auto yuzuBuildVersion =
211 fmt::format(fmt.empty() ? "yuzu Development Build" : fmt, std::string{}, std::string{},
212 std::string{}, std::string{}, std::string{}, build_id);
213
214 LOG_INFO(Frontend, "yuzu Version: {} | {}-{}", yuzuBuildVersion, Common::g_scm_branch,
209 Common::g_scm_desc); 215 Common::g_scm_desc);
210#ifdef ARCHITECTURE_x86_64 216#ifdef ARCHITECTURE_x86_64
211 LOG_INFO(Frontend, "Host CPU: {}", Common::GetCPUCaps().cpu_string); 217 LOG_INFO(Frontend, "Host CPU: {}", Common::GetCPUCaps().cpu_string);