Skip to content

Commit 61abb56

Browse files
committed
Add optional support for debug console for WIN
Currently some errors cannot be diagnosed without LOG traces in debug console. -mwindows option suppresses that console, so there we make it optional. To enable/disable console, pass -DENABLE_WIN_CONSOLE=ON/OFF (default is ON) in configuration phase.
1 parent 4460298 commit 61abb56

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ option(ENABLE_SOUND "Enable sound support (requires SDL2_mixer)" ON)
2828
# Tristate Fluidsynth
2929
set(ENABLE_FLUIDSYNTH "LITE" CACHE STRING "Enable FluidSynth MIDI support (ON/LITE/OFF, default LITE)")
3030
set_property(CACHE ENABLE_FLUIDSYNTH PROPERTY STRINGS "ON" "LITE" "OFF")
31+
option(ENABLE_WIN_CONSOLE "Enable debug console in Windows" ON)
3132

3233
# HAAAAX!!
3334
add_definitions(-DSVGA_SUPPORT)
@@ -378,7 +379,10 @@ add_library(GAME_LIB ${GAME_SRC})
378379

379380
# MINGW additional linker options
380381
if(MINGW)
381-
set(WINDOWS_LIBRARIES mingw32 -mwindows winmm)
382+
set(WINDOWS_LIBRARIES mingw32 winmm)
383+
if(ENABLE_WIN_CONSOLE)
384+
list(APPEND ENABLE_WIN_CONSOLE -mwindows)
385+
endif(ENABLE_WIN_CONSOLE)
382386
endif(MINGW)
383387

384388
target_link_libraries(systemshock
@@ -397,7 +401,6 @@ target_link_libraries(systemshock
397401
INPUT_LIB
398402
PALETTE_LIB
399403
RES_LIB
400-
# SND_LIB
401404
VOX_LIB
402405
EDMS_LIB
403406
FIXPP_LIB

COMPILING.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ Prerequisites:
88
* FluidSynth (optional)
99

1010
The following CMake options are supported in the build process:
11-
* `ENABLE_SOUND` - enable sound support (requires SDL2_mixer)
11+
* `ENABLE_SOUND` - enable sound support (requires SDL2_mixer, default is ON)
1212
* `ENABLE_FLUIDSYNTH` - enable FluidSynth MIDI support (ON/LITE/OFF, default is embedded LITE)
13-
* `ENABLE_OPENGL` - enable OpenGL support (ON/OFF, default ON)
13+
* `ENABLE_OPENGL` - enable OpenGL support (ON/OFF, default is ON)
14+
* `ENABLE_WIN_CONSOLE` - enable debug console for Windows (default is ON)
1415

1516
## Linux
1617

0 commit comments

Comments
 (0)