I added -rdynamic
option in debug build in CMakeLists.txt
like following.
Is there a better or simple way to this?
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_link_libraries(${PROJECT_NAME}
-rdynamic -lm -lpthread -lboost_system
)
else()
target_link_libraries(${PROJECT_NAME}
-lm -lpthread -lboost_system
)
endif()
There is an similar question at What is the modern method for setting general compile flags in CMake? And that answer is a general solution.
But I need a more specific answer for this question.