diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu_cmd/CMakeLists.txt | 9 | ||||
| -rw-r--r-- | src/yuzu_cmd/yuzu.cpp | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt index f6eeb9d8d..61b6cc4e0 100644 --- a/src/yuzu_cmd/CMakeLists.txt +++ b/src/yuzu_cmd/CMakeLists.txt | |||
| @@ -49,6 +49,15 @@ if(UNIX AND NOT APPLE) | |||
| 49 | install(TARGETS yuzu-cmd) | 49 | install(TARGETS yuzu-cmd) |
| 50 | endif() | 50 | endif() |
| 51 | 51 | ||
| 52 | if(WIN32) | ||
| 53 | # compile as a win32 gui application instead of a console application | ||
| 54 | if(MSVC) | ||
| 55 | set_target_properties(yuzu-cmd PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS /ENTRY:mainCRTStartup") | ||
| 56 | elseif(MINGW) | ||
| 57 | set_target_properties(yuzu-cmd PROPERTIES LINK_FLAGS_RELEASE "-Wl,--subsystem,windows") | ||
| 58 | endif() | ||
| 59 | endif() | ||
| 60 | |||
| 52 | if (MSVC) | 61 | if (MSVC) |
| 53 | include(CopyYuzuSDLDeps) | 62 | include(CopyYuzuSDLDeps) |
| 54 | copy_yuzu_SDL_deps(yuzu-cmd) | 63 | copy_yuzu_SDL_deps(yuzu-cmd) |
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index a80649703..91133569d 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp | |||
| @@ -174,6 +174,13 @@ static void OnStatusMessageReceived(const Network::StatusMessageEntry& msg) { | |||
| 174 | 174 | ||
| 175 | /// Application entry point | 175 | /// Application entry point |
| 176 | int main(int argc, char** argv) { | 176 | int main(int argc, char** argv) { |
| 177 | #ifdef _WIN32 | ||
| 178 | if (AttachConsole(ATTACH_PARENT_PROCESS)) { | ||
| 179 | freopen("CONOUT$", "wb", stdout); | ||
| 180 | freopen("CONOUT$", "wb", stderr); | ||
| 181 | } | ||
| 182 | #endif | ||
| 183 | |||
| 177 | Common::Log::Initialize(); | 184 | Common::Log::Initialize(); |
| 178 | Common::Log::SetColorConsoleBackendEnabled(true); | 185 | Common::Log::SetColorConsoleBackendEnabled(true); |
| 179 | Common::Log::Start(); | 186 | Common::Log::Start(); |