From e05296c798610275b3f630aeda3a88c362da29ad Mon Sep 17 00:00:00 2001 From: Zephyron Date: Tue, 23 Sep 2025 15:35:45 +1000 Subject: [PATCH] fix: make updater functionality conditional with CITRON_USE_AUTO_UPDATER option - Add CITRON_USE_AUTO_UPDATER CMake option (default: OFF) - Move updater source files to conditional target_sources block - Add _WIN32 definition for proper moc processing on Windows - Fixes C2664 compilation error with UpdaterDialog::OnUpdateCompleted Signed-off-by: Zephyron --- CMakeLists.txt | 2 ++ src/citron/CMakeLists.txt | 20 +++++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 357690a2d..3e469c386 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,6 +43,8 @@ option(CITRON_USE_QT_MULTIMEDIA "Use QtMultimedia for Camera" OFF) option(CITRON_USE_QT_WEB_ENGINE "Use QtWebEngine for web applet implementation" OFF) +option(CITRON_USE_AUTO_UPDATER "Enable automatic updater functionality" OFF) + option(ENABLE_CUBEB "Enables the cubeb audio backend" ON) option(ENABLE_OPENAL "Enables the OpenAL audio backend" ON) diff --git a/src/citron/CMakeLists.txt b/src/citron/CMakeLists.txt index a968192bb..850e7d97b 100644 --- a/src/citron/CMakeLists.txt +++ b/src/citron/CMakeLists.txt @@ -210,11 +210,6 @@ add_executable(citron startup_checks.h uisettings.cpp uisettings.h - updater/updater_service.cpp - updater/updater_service.h - updater/updater_dialog.cpp - updater/updater_dialog.h - updater/updater_dialog.ui util/clickable_label.cpp util/clickable_label.h util/controller_navigation.cpp @@ -252,6 +247,21 @@ if (CITRON_CRASH_DUMPS) target_compile_definitions(citron PRIVATE CITRON_CRASH_DUMPS) endif() +if (CITRON_USE_AUTO_UPDATER) + target_sources(citron PRIVATE + updater/updater_service.cpp + updater/updater_service.h + updater/updater_dialog.cpp + updater/updater_dialog.h + updater/updater_dialog.ui + ) + + target_compile_definitions(citron PRIVATE + # Ensure _WIN32 is defined for moc processing on Windows + $<$:_WIN32> + ) +endif() + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_compile_definitions(citron PRIVATE $<$,15>:CANNOT_EXPLICITLY_INSTANTIATE>