cmake: fix debug symbols for C++ code