How to config cmake for strip file

Cleanest possible way is to modify CFLAGS or CXXFLAGS (depending on C or C++ code)


But there is one more hack if you do not want to change your build system (figuring out exact place where to put above lines might be tricky). You may just use strip as standalone application, like:

strip -s a.out

and do this after executable is ready to release as a post-build step. I found this way cleaner, then disturbing compiler flags.

Leave a Comment