From 5a65031611349e22bdcd694479f11c91d87afca7 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Tue, 26 Nov 2019 15:25:19 +1100 Subject: Add a Win32 NoGUI platform and project --- Source/Core/DolphinNoGUI/MainNoGUI.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Source/Core/DolphinNoGUI/MainNoGUI.cpp') diff --git a/Source/Core/DolphinNoGUI/MainNoGUI.cpp b/Source/Core/DolphinNoGUI/MainNoGUI.cpp index 8c27992201..14fac966c9 100644 --- a/Source/Core/DolphinNoGUI/MainNoGUI.cpp +++ b/Source/Core/DolphinNoGUI/MainNoGUI.cpp @@ -12,8 +12,11 @@ #include #ifndef _WIN32 #include +#else +#include #endif +#include "Common/StringUtil.h" #include "Core/Analytics.h" #include "Core/Boot/Boot.h" #include "Core/BootManager.h" @@ -121,6 +124,11 @@ static std::unique_ptr GetPlatform(const optparse::Values& options) return Platform::CreateFBDevPlatform(); #endif +#ifdef _WIN32 + if (platform_name == "win32" || platform_name.empty()) + return Platform::CreateWin32Platform(); +#endif + if (platform_name == "headless" || platform_name.empty()) return Platform::CreateHeadlessPlatform(); @@ -142,6 +150,10 @@ int main(int argc, char* argv[]) #if HAVE_X11 , "x11" +#endif +#ifdef _WIN32 + , + "win32" #endif }); @@ -198,6 +210,10 @@ int main(int argc, char* argv[]) s_platform->Stop(); }); +#ifdef _WIN32 + signal(SIGINT, signal_handler); + signal(SIGTERM, signal_handler); +#else // Shut down cleanly on SIGINT and SIGTERM struct sigaction sa; sa.sa_handler = signal_handler; @@ -205,6 +221,7 @@ int main(int argc, char* argv[]) sa.sa_flags = SA_RESETHAND; sigaction(SIGINT, &sa, nullptr); sigaction(SIGTERM, &sa, nullptr); +#endif DolphinAnalytics::Instance().ReportDolphinStart("nogui"); -- cgit v1.2.3