1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-31 18:55:23 +01:00

Allow disabling the version checker

This commit is contained in:
Romain
2025-04-07 23:43:27 +02:00
committed by GitHub
parent a8c476a9a2
commit fd0c20f31a
2 changed files with 6 additions and 2 deletions

View File

@@ -110,6 +110,7 @@ option(DISABLE_GOOGLE_BENCHMARK "Disable Google Benchmarks support." ON)
option(DISABLE_HTTP "Disable HTTP support.")
option(DISABLE_NETWORK "Disable multiplayer functionality. Mainly for testing.")
option(DISABLE_TTF "Disable support for TTF provided by freetype2.")
option(DISABLE_VERSION_CHECKER "Disable the check for newer versions.")
option(ENABLE_SCRIPTING "Enable script / plugin support." ON)
option(ENABLE_ASAN "Enable the AddressSanitizer.")
option(ENABLE_UBSAN "Enable the UndefinedBehaviourSanitizer.")
@@ -136,7 +137,7 @@ if (MACOS_USE_DEPENDENCIES)
message("Using OpenRCT2 dependencies instead of system libraries")
# if we're building on macOS, then we need the dependencies
include(cmake/download.cmake)
set(MACOS_DYLIBS_VERSION "37")
set(MACOS_DYLIBS_ZIPFILE "openrct2-libs-v${MACOS_DYLIBS_VERSION}-universal-macos-dylibs.zip")
set(MACOS_DYLIBS_SHA1 "6d633a881fc243e960e29d9c371915a7cdeeb880")
@@ -397,6 +398,9 @@ endif ()
if (DISABLE_TTF)
target_compile_options(libopenrct2 PUBLIC -DNO_TTF)
endif ()
if (DISABLE_VERSION_CHECKER)
target_compile_options(libopenrct2 PUBLIC -DDISABLE_VERSION_CHECKER)
endif ()
if (ENABLE_SCRIPTING)
target_compile_options(libopenrct2 PUBLIC -DENABLE_SCRIPTING)
endif ()

View File

@@ -71,7 +71,7 @@ NewVersionInfo GetLatestVersion()
// with invalid data.
std::string tag = gVersionInfoTag;
NewVersionInfo verinfo{ tag, "", "", "" };
#ifndef DISABLE_HTTP
#if !defined(DISABLE_HTTP) && !defined(DISABLE_VERSION_CHECKER)
auto now = std::chrono::duration_cast<std::chrono::seconds>(std::chrono::system_clock::now().time_since_epoch()).count();
auto then = Config::Get().general.LastVersionCheckTime;
using namespace std::chrono_literals;