mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge pull request #1300 from Learath2/dd_pr_autoupdateflag
CMake option to disable autoupdater. Closes #1292
This commit is contained in:
commit
b0759830b7
|
@ -52,6 +52,11 @@ jobs:
|
|||
cd build
|
||||
env CFLAGS="-Wdeclaration-after-statement -Werror" CXXFLAGS="-Werror" cmake -DDOWNLOAD_GTEST=ON ..
|
||||
make everything
|
||||
- run: |
|
||||
mkdir build2
|
||||
cd build2
|
||||
env CFLAGS="-Wdeclaration-after-statement -Werror" CXXFLAGS="-Werror" cmake -DAUTOUPDATE=OFF -DDOWNLOAD_GTEST=ON ..
|
||||
make everything
|
||||
|
||||
- persist-to-workspace:
|
||||
root: ./
|
||||
|
@ -72,6 +77,10 @@ jobs:
|
|||
make run_tests
|
||||
./DDNet-Server shutdown
|
||||
|
||||
- run: |
|
||||
cd build2
|
||||
make run_tests
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
build_and_test:
|
||||
|
|
|
@ -68,12 +68,17 @@ else()
|
|||
endif()
|
||||
|
||||
set(AUTO_DEPENDENCIES_DEFAULT OFF)
|
||||
set(AUTOUPDATE_DEFAULT OFF)
|
||||
if(TARGET_OS STREQUAL "windows")
|
||||
set(AUTO_DEPENDENCIES_DEFAULT ON)
|
||||
set(AUTOUPDATE_DEFAULT ON)
|
||||
elseif(TARGET_OS STREQUAL "linux")
|
||||
set(AUTOUPDATE_DEFAULT ON)
|
||||
endif()
|
||||
|
||||
option(WEBSOCKETS "Enable websockets support" OFF)
|
||||
option(MYSQL "Enable mysql support" OFF)
|
||||
option(AUTOUPDATE "Enable the autoupdater" ${AUTOUPDATE_DEFAULT})
|
||||
option(CLIENT "Compile client" ON)
|
||||
option(DOWNLOAD_GTEST "Download and compile GTest" ${AUTO_DEPENDENCIES_DEFAULT})
|
||||
option(PREFER_BUNDLED_LIBS "Prefer bundled libraries over system libraries" ${AUTO_DEPENDENCIES_DEFAULT})
|
||||
|
@ -1538,6 +1543,9 @@ foreach(target ${TARGETS_OWN})
|
|||
target_compile_definitions(${target} PRIVATE CONF_SQL)
|
||||
target_include_directories(${target} PRIVATE ${MYSQL_INCLUDE_DIRS})
|
||||
endif()
|
||||
if(AUTOUPDATE)
|
||||
target_compile_definitions(${target} PRIVATE CONF_AUTOUPDATE)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
foreach(target ${TARGETS_DEP})
|
||||
|
|
|
@ -2617,7 +2617,7 @@ void CClient::RegisterInterfaces()
|
|||
Kernel()->RegisterInterface(static_cast<IGhostRecorder*>(&m_GhostRecorder), false);
|
||||
Kernel()->RegisterInterface(static_cast<IGhostLoader*>(&m_GhostLoader), false);
|
||||
Kernel()->RegisterInterface(static_cast<IServerBrowser*>(&m_ServerBrowser), false);
|
||||
#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__)
|
||||
#if defined(CONF_AUTOUPDATE)
|
||||
Kernel()->RegisterInterface(static_cast<IUpdater*>(&m_Updater), false);
|
||||
#endif
|
||||
Kernel()->RegisterInterface(static_cast<IFriends*>(&m_Friends), false);
|
||||
|
@ -2635,7 +2635,7 @@ void CClient::InitInterfaces()
|
|||
m_pInput = Kernel()->RequestInterface<IEngineInput>();
|
||||
m_pMap = Kernel()->RequestInterface<IEngineMap>();
|
||||
m_pMasterServer = Kernel()->RequestInterface<IEngineMasterServer>();
|
||||
#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__)
|
||||
#if defined(CONF_AUTOUPDATE)
|
||||
m_pUpdater = Kernel()->RequestInterface<IUpdater>();
|
||||
#endif
|
||||
m_pStorage = Kernel()->RequestInterface<IStorage>();
|
||||
|
@ -2646,7 +2646,7 @@ void CClient::InitInterfaces()
|
|||
|
||||
HttpInit(m_pStorage);
|
||||
|
||||
#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__)
|
||||
#if defined(CONF_AUTOUPDATE)
|
||||
m_Updater.Init();
|
||||
#endif
|
||||
|
||||
|
@ -2832,7 +2832,7 @@ void CClient::Run()
|
|||
// update input
|
||||
if(Input()->Update())
|
||||
break; // SDL_QUIT
|
||||
#if !defined(CONF_PLATFORM_MACOSX) && !defined(__ANDROID__)
|
||||
#if defined(CONF_AUTOUPDATE)
|
||||
Updater()->Update();
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue