Re #209 Added OPTION_UNLOAD_SSGGRAPH CMake option (default: true) to enable not unloading ssggraph (usefull on some Linuxes where this makes XOrg crash) + Re #475 Separate OPTION_DEBUG in 2, to make it possible not to define DEBUG cpp symbol (asked by Fedora packagers ; but we'll keep -DDEBUG until 2.0 is out cause we fear issues with MSVC

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@4002 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: ecd105cf4f87001a1050dceb7ad8de82ac408af8
Former-commit-id: acee4981263ac9f181290c9f0bf2ede63cd9e7b2
This commit is contained in:
pouillot 2011-10-26 16:56:13 +00:00
parent ec197c3f81
commit b6cc1f7aae
2 changed files with 17 additions and 4 deletions

View file

@ -961,11 +961,13 @@ MACRO(ADD_SD_COMPILE_OPTIONS)
IF(NOT _ALREADY_DONE)
# CMake options.
SET(OPTION_OFFICIAL_ONLY false CACHE BOOL "Build / install only officially released contents)")
SET(OPTION_OFFICIAL_ONLY false CACHE BOOL "Build / install only officially released contents")
SET(OPTION_DEBUG true CACHE BOOL "Enable traces into the console or log file")
SET(OPTION_DEBUG true CACHE BOOL "Enable debug symbols even in Release build")
SET(OPTION_TRACE_LEVEL "5" CACHE STRING "Trace level integer threshold, only if OPTION_DEBUG (traces with higher level are not logged ; 0=Fatal, 1=Error, 2=Warning, 3=Info, 4=Trace, 5=Debug, ...)")
SET(OPTION_TRACE true CACHE BOOL "Enable traces into the console or log file")
SET(OPTION_TRACE_LEVEL "5" CACHE STRING "Trace level integer threshold, only if OPTION_TRACE (traces with higher level are not logged ; 0=Fatal, 1=Error, 2=Warning, 3=Info, 4=Trace, 5=Debug, ...)")
SET(OPTION_PROFILER false CACHE BOOL "Enable profiler")
@ -974,6 +976,7 @@ MACRO(ADD_SD_COMPILE_OPTIONS)
IF(UNIX)
SET(OPTION_XRANDR true CACHE BOOL "XrandR")
SET(OPTION_GLEXTPROTOTYPES true CACHE BOOL "Enable prototypes in glext.h")
SET(OPTION_UNLOAD_SSGGRAPH true CACHE BOOL "If false, never unload ssggraph module (useful on some Linuxes to avoid XOrg crashes)")
ENDIF(UNIX)
# Compiler definitions.
@ -985,8 +988,11 @@ MACRO(ADD_SD_COMPILE_OPTIONS)
ENDIF(MSVC)
IF(OPTION_DEBUG)
ADD_DEFINITIONS(-DDEBUG -DTRACE_OUT)
ADD_DEFINITIONS(-DDEBUG)
ENDIF(OPTION_DEBUG)
IF(OPTION_TRACE)
ADD_DEFINITIONS(-DTRACE_OUT)
ENDIF(OPTION_TRACE)
IF(OPTION_TRACE_LEVEL)
ADD_DEFINITIONS(-DTRACE_LEVEL=${OPTION_TRACE_LEVEL})
ENDIF(OPTION_TRACE_LEVEL)
@ -1004,6 +1010,10 @@ MACRO(ADD_SD_COMPILE_OPTIONS)
ADD_DEFINITIONS(-DGL_GLEXT_PROTOTYPES)
ENDIF(OPTION_GLEXTPROTOTYPES)
IF(OPTION_UNLOAD_SSGGRAPH)
ADD_DEFINITIONS(-DUNLOAD_SSGGRAPH)
ENDIF(OPTION_UNLOAD_SSGGRAPH)
# Define for code that needs Torcs backward compatibility
ADD_DEFINITIONS(-DSPEED_DREAMS)

View file

@ -440,6 +440,9 @@ void LegacyMenu::shutdownGraphics(bool bUnloadModule)
{
// Unload the graphics module.
GfModule* pmodGrEngine = dynamic_cast<GfModule*>(_piGraphicsEngine);
#ifndef UNLOAD_SSGGRAPH
if (pmodGrEngine->getSharedLibName().find("ssggraph") == std::npos)
#endif
GfModule::unload(pmodGrEngine);
// And remember it was.