cmake 生成 compile_commands.json


New in version 3.5.

Enable/Disable output of compile commands during generation.

This option is implemented only by Makefile Generators and the Ninja. It is ignored on other generators.

Makefile Generators

Borland Makefiles
MSYS Makefiles
MinGW Makefiles
NMake Makefiles
NMake Makefiles JOM
Unix Makefiles
Watcom WMake

打開 vs 的 console

可先手動打開,然后使用process hacker查看程序啟動的命令,就可以找到如下命令,可從控制台打開vs 的 console,不用手動打開:

cmd /k "C:\Program Files\Microsoft Visual Studio\xxxx\yyyy\VC\Auxiliary\Build\vcvars64.bat"

在打開的vs cosole中輸入:

cmake .. -G "NMake Makefiles" -DCMAKE_EXPORT_COMPILE_COMMANDS=1

生成compile_commands.json


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM