Add compile/link flags to force debug symbols even for Release builds.
When compiling a CMake release build, CMake doesn't invoke the compiler / linker with flags needed to preserve debugging information. There is a RelWithDebInfo target which does set these flags, but it sets the optimization a bit lower than Release to favor better debugging over performance optimizations. This change forces the flags to be enabled in all builds (even Release), while keeping all release optimizations enabled. (Note: this can mean the debugging information isn't completely accurate or has some missing information due to compiler optimizations; but it will be enough to decode the stack frames with gdb or windbg to see the function names.)
This change also enables link-time code generation (LTCG) / interprocedural optimization (IPO) when supported by the compiler.