Merge pull request #10516 from OatmealDome/steam

CMakeLists: Add flag to enable / disable automatic update support
This commit is contained in:
Pierre Bourdon 2022-03-18 08:33:13 +01:00 committed by GitHub
commit f73b2d70a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -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)
#

View File

@ -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()

View File

@ -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()