Don't pre-strip binaries

Currently the binaries are stripped during linking through some settings in adm/cmake/occt_defs_flags.cmake. This can lead to issues on distributions, where the package manager applications is supposed to strip binaries[1] or extract debugging information for later usage in case of debug builds.

Would it be possible to add a cmake option, so at configuration time it could be decided whether the binaries are being stripped during linking stage or not?

[1] https://bugs.gentoo.org/831800

Kirill Gavrilov's picture

Fill free to propose patches improving CMake logic upon stripping symbols. There is a room for possible improvements here, like separate debug symbols from main libraries or postpone stripping to a later building / installing stage. But unfortunately, this is not just putting a flag to CMake - it requires some platform-specific adaptations.

If non-stripping of Release builds is the only thing you are looking for, then you may consider handling of BUILD_FORCE_RelWithDebInfo flag (currently implemented only for Windows - it asks to generate PDB debug files for Release build) to remove stripping from GCC/CLang arguments.