From 2836dd2b5ec95492076e3af41a6b1634f87ee5e4 Mon Sep 17 00:00:00 2001 From: Dentomologist Date: Thu, 30 Oct 2025 11:54:25 -0700 Subject: [PATCH] libmgba: Fix build when disabled --- Source/Core/Core/HW/GBACore.cpp | 3 +++ Source/Core/Core/HW/GBACore.h | 3 +++ Source/Core/Core/HW/SI/SI_DeviceGBAEmu.cpp | 3 +++ Source/Core/Core/HW/SI/SI_DeviceGBAEmu.h | 3 +++ Source/Core/DolphinQt/GBAHost.cpp | 3 +++ Source/Core/DolphinQt/GBAHost.h | 3 +++ Source/Core/DolphinQt/GBAWidget.cpp | 3 +++ Source/Core/DolphinQt/GBAWidget.h | 3 +++ Source/Core/DolphinQt/Settings/GameCubePane.cpp | 4 ++++ Source/Core/DolphinQt/Settings/GameCubePane.h | 3 +++ 10 files changed, 31 insertions(+) diff --git a/Source/Core/Core/HW/GBACore.cpp b/Source/Core/Core/HW/GBACore.cpp index cd379a17a6b..b25414f3b1a 100644 --- a/Source/Core/Core/HW/GBACore.cpp +++ b/Source/Core/Core/HW/GBACore.cpp @@ -1,6 +1,8 @@ // Copyright 2021 Dolphin Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#ifdef HAS_LIBMGBA + #include "Core/HW/GBACore.h" #define PYCPARSE // Remove static functions from the header @@ -753,3 +755,4 @@ std::string Core::GetSavePath(std::string_view rom_path, int device_number) return save_path; } } // namespace HW::GBA +#endif // HAS_LIBMGBA diff --git a/Source/Core/Core/HW/GBACore.h b/Source/Core/Core/HW/GBACore.h index 3a149a54fd1..6fd4b86e0c2 100644 --- a/Source/Core/Core/HW/GBACore.h +++ b/Source/Core/Core/HW/GBACore.h @@ -3,6 +3,8 @@ #pragma once +#ifdef HAS_LIBMGBA + #include #include #include @@ -147,3 +149,4 @@ private: ::Core::System& m_system; }; } // namespace HW::GBA +#endif // HAS_LIBMGBA diff --git a/Source/Core/Core/HW/SI/SI_DeviceGBAEmu.cpp b/Source/Core/Core/HW/SI/SI_DeviceGBAEmu.cpp index 45067913582..b9c22f1d585 100644 --- a/Source/Core/Core/HW/SI/SI_DeviceGBAEmu.cpp +++ b/Source/Core/Core/HW/SI/SI_DeviceGBAEmu.cpp @@ -1,6 +1,8 @@ // Copyright 2021 Dolphin Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#ifdef HAS_LIBMGBA + #include "Core/HW/SI/SI_DeviceGBAEmu.h" #include @@ -174,3 +176,4 @@ void CSIDevice_GBAEmu::OnEvent(u64 userdata, s64 cycles_late) m_system.GetSerialInterface().ScheduleEvent(m_device_number, num_cycles); } } // namespace SerialInterface +#endif // HAS_LIBMGBA diff --git a/Source/Core/Core/HW/SI/SI_DeviceGBAEmu.h b/Source/Core/Core/HW/SI/SI_DeviceGBAEmu.h index 34eba00d881..89a8473b4dc 100644 --- a/Source/Core/Core/HW/SI/SI_DeviceGBAEmu.h +++ b/Source/Core/Core/HW/SI/SI_DeviceGBAEmu.h @@ -3,6 +3,8 @@ #pragma once +#ifdef HAS_LIBMGBA + #include #include "Common/CommonTypes.h" @@ -47,3 +49,4 @@ private: std::shared_ptr m_gbahost; }; } // namespace SerialInterface +#endif // HAS_LIBMGBA diff --git a/Source/Core/DolphinQt/GBAHost.cpp b/Source/Core/DolphinQt/GBAHost.cpp index 048574ee5f5..453ae674609 100644 --- a/Source/Core/DolphinQt/GBAHost.cpp +++ b/Source/Core/DolphinQt/GBAHost.cpp @@ -1,6 +1,8 @@ // Copyright 2021 Dolphin Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#ifdef HAS_LIBMGBA + #include "DolphinQt/GBAHost.h" #include @@ -47,3 +49,4 @@ std::unique_ptr Host_CreateGBAHost(std::weak_ptr(core); } +#endif // HAS_LIBMGBA diff --git a/Source/Core/DolphinQt/GBAHost.h b/Source/Core/DolphinQt/GBAHost.h index 3c67360c64a..da8c6660ab5 100644 --- a/Source/Core/DolphinQt/GBAHost.h +++ b/Source/Core/DolphinQt/GBAHost.h @@ -3,6 +3,8 @@ #pragma once +#ifdef HAS_LIBMGBA + #include #include "Core/Host.h" @@ -26,3 +28,4 @@ private: GBAWidgetController* m_widget_controller{}; std::weak_ptr m_core; }; +#endif // HAS_LIBMGBA diff --git a/Source/Core/DolphinQt/GBAWidget.cpp b/Source/Core/DolphinQt/GBAWidget.cpp index 794dd40d0a8..d375b3c8c22 100644 --- a/Source/Core/DolphinQt/GBAWidget.cpp +++ b/Source/Core/DolphinQt/GBAWidget.cpp @@ -1,6 +1,8 @@ // Copyright 2021 Dolphin Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#ifdef HAS_LIBMGBA + #include "DolphinQt/GBAWidget.h" #include @@ -615,3 +617,4 @@ void GBAWidgetController::FrameEnded(std::span video_buffer) { m_widget->SetVideoBuffer(video_buffer); } +#endif // HAS_LIBMGBA diff --git a/Source/Core/DolphinQt/GBAWidget.h b/Source/Core/DolphinQt/GBAWidget.h index 8244b77319e..6eea08970e4 100644 --- a/Source/Core/DolphinQt/GBAWidget.h +++ b/Source/Core/DolphinQt/GBAWidget.h @@ -3,6 +3,8 @@ #pragma once +#ifdef HAS_LIBMGBA + #include #include #include @@ -112,3 +114,4 @@ public: private: GBAWidget* m_widget{}; }; +#endif // HAS_LIBMGBA diff --git a/Source/Core/DolphinQt/Settings/GameCubePane.cpp b/Source/Core/DolphinQt/Settings/GameCubePane.cpp index 3df220243bf..98460f6be07 100644 --- a/Source/Core/DolphinQt/Settings/GameCubePane.cpp +++ b/Source/Core/DolphinQt/Settings/GameCubePane.cpp @@ -665,6 +665,8 @@ void GameCubePane::SetAGPRom(ExpansionInterface::Slot slot, const QString& filen LoadSettings(); } +#ifdef HAS_LIBMGBA + void GameCubePane::BrowseGBABios() { QString file = QDir::toNativeSeparators(DolphinFileDialog::getOpenFileName( @@ -699,6 +701,8 @@ void GameCubePane::BrowseGBASaves() } } +#endif // HAS_LIBMGBA + void GameCubePane::LoadSettings() { bool have_menu = false; diff --git a/Source/Core/DolphinQt/Settings/GameCubePane.h b/Source/Core/DolphinQt/Settings/GameCubePane.h index 010da7325d9..bf7c7c2e6de 100644 --- a/Source/Core/DolphinQt/Settings/GameCubePane.h +++ b/Source/Core/DolphinQt/Settings/GameCubePane.h @@ -50,10 +50,13 @@ private: bool SetGCIFolder(ExpansionInterface::Slot slot, const QString& path); void BrowseAGPRom(ExpansionInterface::Slot slot); void SetAGPRom(ExpansionInterface::Slot slot, const QString& filename); + +#ifdef HAS_LIBMGBA void BrowseGBABios(); void BrowseGBARom(size_t index); void SaveRomPathChanged(); void BrowseGBASaves(); +#endif // HAS_LIBMGBA ConfigBool* m_skip_main_menu; ConfigChoice* m_language_combo;