How do you set GDB debug flag with cmake?

后端 未结 2 1599
失恋的感觉
失恋的感觉 2020-12-12 19:31

I have tried setting the debug flags using the

set

command in cmake but I cam unsure what to add. I have been told things like

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-12 19:55

    If you want to build for debug (including source information, i.e. -g) when compiling, use

    cmake -DCMAKE_BUILD_TYPE=Debug 
    

    If you want to build a release build, you can use

    cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo 
    

提交回复
热议问题