Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #10516 from OatmealDome/steam
CMakeLists: Add flag to enable / disable automatic update support
  • Loading branch information
delroth committed Mar 18, 2022
2 parents bf261f6 + e23df93 commit f73b2d7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Expand Up @@ -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:
Expand Down Expand Up @@ -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)
#
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/CMakeLists.txt
Expand Up @@ -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()
4 changes: 4 additions & 0 deletions Source/Core/UICommon/AutoUpdate.cpp
Expand Up @@ -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()
Expand Down

0 comments on commit f73b2d7

Please sign in to comment.