Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 4.2k
    • Issues 4.2k
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 10
    • Merge requests 10
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMakeCMake
  • CMakeCMake
  • Issues
  • #20256
Closed
Open
Issue created Jan 23, 2020 by Cristian Adam@cristianadamDeveloper

Separate debug information

If I build an application with RelWithDebInfo build type I will get a release with debug information build.

Now if I want to distribute the application I don't want to ship the debug information, since it tends to be big. But make it available in the situation that my application crashes so that the call stack makes sense.

CMake offers in CPackDeb.cmake the ability to have files generated by objcopy --only-keep-debug calls.

Unfortunately there is nothing about dsymutil for macOS.

Users have done the following for macOS:

find_program(DSYMUTIL_PROGRAM dsymutil)
if (DSYMUTIL_PROGRAM)
  foreach(lang C CXX)
    foreach(var LINK_EXECUTABLE CREATE_SHARED_LIBRARY)
      set(CMAKE_${lang}_${var} "${CMAKE_${lang}_${var}}" "${DSYMUTIL_PROGRAM} <TARGET>")
    endforeach()
  endforeach()
endif()

I was thinking at having a per target property SEPARATE_DEBUG_INFO initialized by CMAKE_SEPARATE_DEBUG_INFO which would call objcopy --only-keep-debug for GNU, dsymutil for macOS/Clang.

Then when the user issues an install(TARGET) add the above generated debug file to a component named DebugInfo.

Then when the user does a cmake --install . --component DebugInfo the debug files will be installed. This would include the MSVC's PDB files.

Then one just has to pack / archive the directory and it's not specific only to a CPack format.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking