cmake compile with debug symbols
If you are able to see source and set the breakpoint, then you probably have debugging symbols established. CMake provides a primary user interface based on granular handling of the following compiler ids as of the Thanks for contributing an answer to Stack Overflow! But first: lets automate this into CMake. meta-feature (e.g. for each target. ", Tank you for answer. See this note from man obj-copy: only-keep-debug Strip a file, removing contents of any sections that would not be tripped by strip-debug and leaving the debugging sections intact. This variable is initialized by the first project() or enable_language() command called in a project when a new build tree is first created. To learn more, see our tips on writing great answers. How do I get debugging symbols to work? Chip's answer was helpful, however since the SET line overwrote CMAKE_CXX_FLAGS_DEBUG this removed the -g default which caused my executable to be built without debug info. When working with a big project on a resource constrained embedded hardware, it might be difficult to debug it properly on the target board. I think this should be the default behavior, it is intuitive. How can I easily generate a list of symbols with static storage? I would say that changing CMAKE_BUILD_TYPE any way except for by passing directly to cmake should be avoided. default (see CMAKE_