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 endif
ifeq ($(WINDOWS_BUILD),1) 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),) ifeq ($(CROSS),)
LDFLAGS += -no-pie LDFLAGS += -no-pie
endif endif

View file

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