From e23df9369dfcc8e02c1d2b6de39166a5b9dd80db Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Tue, 15 Mar 2022 18:40:13 -0400 Subject: [PATCH] CMakeLists: Add option to disable automatic update support --- CMakeLists.txt | 6 ++++++ Source/Core/CMakeLists.txt | 4 ++-- Source/Core/UICommon/AutoUpdate.cpp | 4 ++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 39a03e0db5..eb477289dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,6 +50,7 @@ option(ENABLE_TESTS "Enables building the unit tests" ON) option(ENABLE_VULKAN "Enables vulkan video backend" ON) option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence, show the current game on Discord" ON) option(USE_MGBA "Enables GBA controllers emulation using libmgba" ON) +option(ENABLE_AUTOUPDATE "Enables support for automatic updates" ON) # Maintainers: if you consider blanket disabling this for your users, please # consider the following points: @@ -536,6 +537,11 @@ if(ENABLE_ANALYTICS) add_definitions(-DUSE_ANALYTICS=1) endif() +if(ENABLE_AUTOUPDATE) + message(STATUS "Enabling automatic update support") + add_definitions(-DAUTOUPDATE=1) +endif() + ######################################## # Setup include directories (and make sure they are preferred over the Externals) # diff --git a/Source/Core/CMakeLists.txt b/Source/Core/CMakeLists.txt index 8dd46c1602..576e3eec62 100644 --- a/Source/Core/CMakeLists.txt +++ b/Source/Core/CMakeLists.txt @@ -23,10 +23,10 @@ if (APPLE OR WIN32) add_subdirectory(UpdaterCommon) endif() -if (APPLE) +if (APPLE AND ENABLE_AUTOUPDATE) add_subdirectory(MacUpdater) endif() -if (WIN32) +if (WIN32 AND ENABLE_AUTOUPDATE) add_subdirectory(WinUpdater) endif() diff --git a/Source/Core/UICommon/AutoUpdate.cpp b/Source/Core/UICommon/AutoUpdate.cpp index e423b9ec86..d02c2356b3 100644 --- a/Source/Core/UICommon/AutoUpdate.cpp +++ b/Source/Core/UICommon/AutoUpdate.cpp @@ -128,11 +128,15 @@ std::string GenerateChangelog(const picojson::array& versions) bool AutoUpdateChecker::SystemSupportsAutoUpdates() { +#if defined AUTOUPDATE #if defined _WIN32 || defined __APPLE__ return true; #else return false; #endif +#else + return false; +#endif } static std::string GetPlatformID()