Fix --help and improve console launch param

This commit is contained in:
Agent X 2024-03-09 11:59:28 -05:00
parent 31a67658ec
commit 836a7cbdd7
2 changed files with 4 additions and 6 deletions

View file

@ -856,7 +856,7 @@ ifeq ($(TARGET_N64),1)
endif
ifeq ($(WINDOWS_BUILD),1)
LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -Llib -lpthread $(BACKEND_LDFLAGS) -static
LDFLAGS := $(BITS) -march=$(TARGET_ARCH) -Llib -lpthread $(BACKEND_LDFLAGS) -static -mconsole
ifeq ($(CROSS),)
LDFLAGS += -no-pie
endif

View file

@ -338,12 +338,10 @@ int main(int argc, char *argv[]) {
#if defined(_WIN32) || defined(_WIN64)
// Handle Windows console
if (gCLIOpts.Console && AllocConsole()) {
FILE* fDummy;
freopen_s(&fDummy, "CONOUT$", "w", stdout);
freopen_s(&fDummy, "CONOUT$", "w", stderr);
freopen_s(&fDummy, "CONIN$", "r", stdin);
if (!gCLIOpts.Console) {
FreeConsole();
}
#endif
// Create the window straight away