1
0
mirror of synced 2024-11-28 09:30:51 +01:00

Properly added back console window on Windows debug builds

This commit is contained in:
WerWolv 2021-01-31 22:05:06 +01:00
parent ee8e1996d9
commit 0a3cfe001d
2 changed files with 5 additions and 18 deletions

View File

@ -98,7 +98,11 @@ macro(configurePackageCreation)
endif()
if (WIN32)
set(application_type WIN32)
if (CMAKE_BUILD_TYPE EQUAL "DEBUG")
set(application_type WIN32)
else ()
set(application_type)
endif ()
set(imhex_icon "${PROJECT_SOURCE_DIR}/res/resource.rc")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++ -static-libgcc -Wl,--allow-multiple-definition -static -Wl,-Bstatic,--whole-archive -lwinpthread -Wl,--no-whole-archive")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wl,-subsystem,windows")

View File

@ -18,10 +18,6 @@
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#if defined(OS_WINDOWS)
#include <windows.h>
#endif
namespace hex {
constexpr auto MenuBarItems = { "File", "Edit", "View", "Help" };
@ -53,19 +49,6 @@ namespace hex {
hex::SharedData::mainArgc = argc;
hex::SharedData::mainArgv = argv;
// Try to attach to a currently open console on Windows if available
#if defined(OS_WINDOWS)
if (AttachConsole(ATTACH_PARENT_PROCESS)) {
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
if (hStdOut != INVALID_HANDLE_VALUE) {
freopen("CONOUT$", "w", stdout);
freopen("CONERR$", "w", stderr);
setvbuf(stdout, nullptr, _IONBF, 0);
setvbuf(stderr, nullptr, _IONBF, 0);
}
}
#endif
this->initGLFW();
this->initImGui();