From 70d6a1ac3990c0b32cc32227344c711fd72e012f Mon Sep 17 00:00:00 2001 From: Andy Vandijck Date: Fri, 27 Jun 2025 11:45:17 +0200 Subject: [PATCH] Make Sparkle framework optional --- src/wx/CMakeLists.txt | 2 +- src/wx/autoupdater/macos/autoupdater.cpp | 8 ++++++-- src/wx/macsupport.mm | 10 ++++++++++ tools/builder/core.sh | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/wx/CMakeLists.txt b/src/wx/CMakeLists.txt index 76bda3c6..976c6c0d 100644 --- a/src/wx/CMakeLists.txt +++ b/src/wx/CMakeLists.txt @@ -844,7 +844,7 @@ if(APPLE AND ENABLE_ONLINEUPDATES) COMMAND ${CCS8} ) - TARGET_LINK_LIBRARIES(visualboyadvance-m ${SPARKLE_FRAMEWORK}) + TARGET_LINK_LIBRARIES(visualboyadvance-m $) endif() if(NOT WIN32 AND NOT APPLE) diff --git a/src/wx/autoupdater/macos/autoupdater.cpp b/src/wx/autoupdater/macos/autoupdater.cpp index cf8f27ef..aae0d20d 100644 --- a/src/wx/autoupdater/macos/autoupdater.cpp +++ b/src/wx/autoupdater/macos/autoupdater.cpp @@ -2,17 +2,21 @@ #include "wx/autoupdater/macos/sparkle-wrapper.h" +extern bool is_macosx_1013_or_newer(); + SparkleWrapper autoupdater; void initAutoupdater() { - autoupdater.addAppcastURL("https://data.visualboyadvance-m.org/appcast.xml"); + if (is_macosx_1013_or_newer()) + autoupdater.addAppcastURL("https://data.visualboyadvance-m.org/appcast.xml"); } void checkUpdatesUi() { - autoupdater.checkForUpdatesUi(); + if (is_macosx_1013_or_newer()) + autoupdater.checkForUpdatesUi(); } diff --git a/src/wx/macsupport.mm b/src/wx/macsupport.mm index de12cb58..84ded050 100644 --- a/src/wx/macsupport.mm +++ b/src/wx/macsupport.mm @@ -11,6 +11,16 @@ #include "wx/wxvbam.h" #ifndef NO_METAL +bool is_macosx_1013_or_newer() +{ + // Mac OS X 10.12 version check + if (NSAppKitVersionNumber >= 1561) { + return true; + } + + return false; +} + bool is_macosx_1012_or_newer() { // Mac OS X 10.12 version check diff --git a/tools/builder/core.sh b/tools/builder/core.sh index 43f722de..59772909 100644 --- a/tools/builder/core.sh +++ b/tools/builder/core.sh @@ -202,7 +202,7 @@ FFMPEG_DISTS=' libvpx libx264 libx265 libxavs libzmq libzvbi ffmpeg ' -PROJECT_ARGS="-DDISABLE_MACOS_PACKAGE_MANAGERS=TRUE -DENABLE_ONLINEUPDATES=OFF -DwxWidgets_CONFIG_EXECUTABLE='$BUILD_ROOT/root/bin/wx-config' -DwxWidgets_CONFIG_OPTIONS='--prefix=$BUILD_ROOT/root' -DBUILD_TESTING=NO" +PROJECT_ARGS="-DDISABLE_MACOS_PACKAGE_MANAGERS=TRUE -DENABLE_ONLINEUPDATES=ON -DwxWidgets_CONFIG_EXECUTABLE='$BUILD_ROOT/root/bin/wx-config' -DwxWidgets_CONFIG_OPTIONS='--prefix=$BUILD_ROOT/root' -DBUILD_TESTING=NO" : ${PATH_SEP:=':'}