From d782a4922904374b22797db8243b62b15eb9a690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 19 Apr 2023 14:54:58 +0200 Subject: [PATCH] Enable building a gold version for mac. --- CMakeLists.txt | 19 +++++++++++++------ SDL/SDLMain.cpp | 3 ++- UI/MiscScreens.cpp | 4 ++-- Windows/main.cpp | 6 +----- b.sh | 3 +++ 5 files changed, 21 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cf5d555837..22c6473cee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2490,11 +2490,18 @@ endif() if(TargetBin) if(APPLE) if(NOT IOS) - set(ICON_PATH_ABS ${CMAKE_CURRENT_SOURCE_DIR}/icons/ppsspp.icns) - set(MACOSX_BUNDLE_ICON_FILE ppsspp.icns) + if(GOLD) + set(ICON_PATH_ABS ${CMAKE_CURRENT_SOURCE_DIR}/icons/ppsspp_gold.icns) + set(MACOSX_BUNDLE_ICON_FILE ppsspp_gold.icns) + set(MACOSX_BUNDLE_BUNDLE_NAME "PPSSPP Gold") + set(MACOSX_BUNDLE_GUI_IDENTIFIER org.ppsspp.ppssppgold) + else() + set(ICON_PATH_ABS ${CMAKE_CURRENT_SOURCE_DIR}/icons/ppsspp.icns) + set(MACOSX_BUNDLE_ICON_FILE ppsspp.icns) + set(MACOSX_BUNDLE_BUNDLE_NAME "PPSSPP") + set(MACOSX_BUNDLE_GUI_IDENTIFIER org.ppsspp.ppsspp) + endif() set_source_files_properties(${ICON_PATH_ABS} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") - set(MACOSX_BUNDLE_BUNDLE_NAME PPSSPP) - set(MACOSX_BUNDLE_GUI_IDENTIFIER org.ppsspp.ppsspp) endif() # TODO: there must a native way to copy these. @@ -2505,7 +2512,7 @@ if(TargetBin) file(GLOB_RECURSE SHADER_FILES assets/shaders/*) file(GLOB_RECURSE THEME_FILE assets/themes/*) file(GLOB_RECURSE DEBUGGER_FILES assets/debugger/*) - file(GLOB_RECURSE VFPU_FILES assets/vfpu/*) + file(GLOB_RECURSE VFPU_FILES assets/vfpu/*) if(NOT IOS) set_source_files_properties(${BigFontAssets} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets") @@ -2515,7 +2522,7 @@ if(TargetBin) set_source_files_properties(${SHADER_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/shaders") set_source_files_properties(${THEME_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/themes") set_source_files_properties(${DEBUGGER_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/debugger") - set_source_files_properties(${VFPU_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/vfpu") + set_source_files_properties(${VFPU_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/assets/vfpu") endif() if(IOS) diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index 6d09b7df4d..a4c73f0e1b 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -236,7 +236,8 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string case SystemRequestType::SET_WINDOW_TITLE: { std::lock_guard guard(g_mutexWindow); - g_windowState.title = param1.empty() ? "PPSSPP " : param1; + const char *app_name = System_GetPropertyBool(SYSPROP_APP_GOLD) ? "PPSSPP Gold" : "PPSSPP"; + g_windowState.title = param1.empty() ? app_name : param1; g_windowState.update = true; return true; } diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 80c36d7d5a..e1483d0a20 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -912,8 +912,8 @@ void CreditsScreen::render() { specialthankssolarmystic += cr->T("testing"); specialthankssolarmystic += ')'; - const char * credits[] = { - "PPSSPP", + const char *credits[] = { + System_GetPropertyBool(SYSPROP_APP_GOLD) ? "PPSSPP Gold" : "PPSSPP", "", cr->T("title", "A fast and portable PSP emulator"), "", diff --git a/Windows/main.cpp b/Windows/main.cpp index 45e8f96a25..c1e9b11770 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -476,11 +476,7 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string } case SystemRequestType::SET_WINDOW_TITLE: { -#ifdef GOLD - const char *name = "PPSSPP Gold "; -#else - const char *name = "PPSSPP "; -#endif + const char *name = System_GetPropertyBool(SYSPROP_APP_GOLD) ? "PPSSPP Gold " : "PPSSPP "; std::wstring winTitle = ConvertUTF8ToWString(std::string(name) + PPSSPP_GIT_VERSION); if (!param1.empty()) { winTitle.append(ConvertUTF8ToWString(" - " + param1)); diff --git a/b.sh b/b.sh index b68e93e2c7..75df6748af 100755 --- a/b.sh +++ b/b.sh @@ -69,6 +69,9 @@ do --sanitize) echo "Enabling address-sanitizer if available" CMAKE_ARGS="-DUSE_ASAN=ON ${CMAKE_ARGS}" ;; + --gold) echo "Gold build enabled" + CMAKE_ARGS="-DGOLD=ON ${CMAKE_ARGS}" + ;; *) MAKE_OPT="$1 ${MAKE_OPT}" ;; esac