diff options
| author | Stenzek <stenzek@gmail.com> | 2019-11-26 15:25:19 +1100 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2019-12-28 08:56:27 +1000 |
| commit | 5a65031611349e22bdcd694479f11c91d87afca7 (patch) | |
| tree | 4693fab8401d13e95d19a5443d8fd7e4924780d0 /Source/Core/DolphinNoGUI/MainNoGUI.cpp | |
| parent | 0755f9297957881e5c487378a7ba0a9fe92cbd42 (diff) | |
Add a Win32 NoGUI platform and project
Diffstat (limited to 'Source/Core/DolphinNoGUI/MainNoGUI.cpp')
| -rw-r--r-- | Source/Core/DolphinNoGUI/MainNoGUI.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
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 <string> #ifndef _WIN32 #include <unistd.h> +#else +#include <Windows.h> #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<Platform> 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(); @@ -143,6 +151,10 @@ int main(int argc, char* argv[]) , "x11" #endif +#ifdef _WIN32 + , + "win32" +#endif }); optparse::Values& options = CommandLineParse::ParseArguments(parser.get(), argc, argv); @@ -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"); |
