Expose backtrace symbols in Debug mode (#3001)
authorPhilip Hyunsu Cho <chohyu01@cs.washington.edu>
Wed, 10 Apr 2019 04:59:16 +0000 (21:59 -0700)
committerTianqi Chen <tqchen@users.noreply.github.com>
Wed, 10 Apr 2019 04:59:16 +0000 (21:59 -0700)
CMakeLists.txt

index 9317ee3..884c44e 100644 (file)
@@ -84,7 +84,8 @@ else(MSVC)
   include(CheckCXXCompilerFlag)
   check_cxx_compiler_flag("-std=c++11"    SUPPORT_CXX11)
   if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
-    add_compile_options(-O0 -Wall -fPIC -fvisibility=hidden -std=c++11)
+    set(CMAKE_C_FLAGS "-O0 -g -Wall -fPIC ${CMAKE_C_FLAGS} -rdynamic")
+    set(CMAKE_CXX_FLAGS "-O0 -g -Wall -fPIC -std=c++11 ${CMAKE_CXX_FLAGS} -rdynamic")
   else()
     set(CMAKE_C_FLAGS "-O2 -Wall -fPIC -fvisibility=hidden ${CMAKE_C_FLAGS}")
     set(CMAKE_CXX_FLAGS "-O2 -Wall -fPIC -fvisibility=hidden -std=c++11 ${CMAKE_CXX_FLAGS}")