From a67be4442245f7b709946bc011da125a61d6bc33 Mon Sep 17 00:00:00 2001 From: Deve Date: Sun, 12 Nov 2017 23:55:28 +0100 Subject: [PATCH] Allow to compile STKRelease build with debug symbols. It may be useful for decoding backtraces from our linux static package. --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9687b047e..64b1798f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,10 @@ if (UNIX AND NOT APPLE) option(USE_GLES2 "Use OpenGL ES2 renderer" OFF) endif() +if(UNIX OR MINGW) + option(DEBUG_SYMBOLS "Compile with debug symbols" OFF) +endif() + if(MSVC AND (MSVC_VERSION LESS 1900)) # Normally hide the option to build wiiuse on VS, since it depends # on the installation of the Windows DDK (Driver Developer Kit), @@ -90,6 +94,13 @@ endif() # add_definitions(-DNO_VPX) #endif() +if(UNIX OR MINGW) + if(DEBUG_SYMBOLS) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g") + endif() +endif() + # Build the Bullet physics library add_subdirectory("${PROJECT_SOURCE_DIR}/lib/bullet") include_directories("${PROJECT_SOURCE_DIR}/lib/bullet/src")