[CMake] cmake -gsplit-dwarf dwp and install step

David Jobet djobet at tower-research.com
Fri Dec 21 06:38:43 EST 2018


Hello,

in order to speed up our link step, I wanted to experiment with split dwarf.
See http://www.productive-cpp.com/improving-cpp-builds-with-split-dwarf/

Adding the compilation flag is easy, but I'm stumbling on the installation step.
In our current mode, we redirect the STRIP step to extract the symbols
and strip the binary.

With split dwarf, I want to use 'dwp' to collect all .dwo files and
assemble a symbol file. No need to strip I guess since symbols are
already put elsewhere.

So I figure I would just use dwp as the strip command in my custom
strip command.

Problem is .dwo files are recorded in the .o files relative to the
build directory and the strip command is executed on the installed
directory.
As a result, 'dwp' complains it cannot find the .dwo files.

I don't want to add a POST_BUILD step on each our binaries (we have
lots of binaries), and anyway I'd rather prefer to have the 'dwp' step
executed at install time so it's executed only when we want to
deliver.

Is there a way to either
- pass the build_dir to the strip command ?
- define a custom step of the install process that would execute on
the build dir previous to the install step itself ? (for the same
reason I don't want to manually define a POST_BUILD step on each
binaries, I don't want to manually define a custom INSTALL step that
would precede the INSTALL step of all our binaries)
- or another option ?

With regards

David


More information about the CMake mailing list