Skip to content

Commit

Permalink
Add optional support for debug console for WIN
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
winterheart committed Dec 26, 2020
1 parent f93c66e commit 19e5c40
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ option(ENABLE_SOUND "Enable sound support (requires SDL2_mixer)" ON)
# Tristate Fluidsynth
set(ENABLE_FLUIDSYNTH "LITE" CACHE STRING "Enable FluidSynth MIDI support (ON/LITE/OFF, default LITE)")
set_property(CACHE ENABLE_FLUIDSYNTH PROPERTY STRINGS "ON" "LITE" "OFF")
option(ENABLE_WIN_CONSOLE "Enable debug console in Windows" ON)

# HAAAAX!!
add_definitions(-DSVGA_SUPPORT)
Expand Down Expand Up @@ -378,7 +379,10 @@ add_library(GAME_LIB ${GAME_SRC})

# MINGW additional linker options
if(MINGW)
set(WINDOWS_LIBRARIES mingw32 -mwindows winmm)
set(WINDOWS_LIBRARIES mingw32 winmm)
if(ENABLE_WIN_CONSOLE)
list(APPEND ENABLE_WIN_CONSOLE -mwindows)
endif(ENABLE_WIN_CONSOLE)
endif(MINGW)

target_link_libraries(systemshock
Expand All @@ -397,7 +401,6 @@ target_link_libraries(systemshock
INPUT_LIB
PALETTE_LIB
RES_LIB
# SND_LIB
VOX_LIB
EDMS_LIB
FIXPP_LIB
Expand Down
5 changes: 3 additions & 2 deletions COMPILING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ Prerequisites:
* FluidSynth (optional)

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

## Linux

Expand Down

0 comments on commit 19e5c40

Please sign in to comment.