Properly added back console window on Windows debug builds
This commit is contained in:
parent
ee8e1996d9
commit
0a3cfe001d
@ -98,7 +98,11 @@ macro(configurePackageCreation)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
if (CMAKE_BUILD_TYPE EQUAL "DEBUG")
|
||||||
set(application_type WIN32)
|
set(application_type WIN32)
|
||||||
|
else ()
|
||||||
|
set(application_type)
|
||||||
|
endif ()
|
||||||
set(imhex_icon "${PROJECT_SOURCE_DIR}/res/resource.rc")
|
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 "${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")
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wl,-subsystem,windows")
|
||||||
|
@ -18,10 +18,6 @@
|
|||||||
#include <glad/glad.h>
|
#include <glad/glad.h>
|
||||||
#include <GLFW/glfw3.h>
|
#include <GLFW/glfw3.h>
|
||||||
|
|
||||||
#if defined(OS_WINDOWS)
|
|
||||||
#include <windows.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace hex {
|
namespace hex {
|
||||||
|
|
||||||
constexpr auto MenuBarItems = { "File", "Edit", "View", "Help" };
|
constexpr auto MenuBarItems = { "File", "Edit", "View", "Help" };
|
||||||
@ -53,19 +49,6 @@ namespace hex {
|
|||||||
hex::SharedData::mainArgc = argc;
|
hex::SharedData::mainArgc = argc;
|
||||||
hex::SharedData::mainArgv = argv;
|
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->initGLFW();
|
||||||
this->initImGui();
|
this->initImGui();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user