Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
CREATE_PROJECT: export compile_commands.json via cmake #2525
This is useful for e.g. clangd or other clang based tools like the analyser.
I'm using the generated
Install the clangd plugin for vscode, execute
cd devtools/create_project/cmake cmake . cmake --build . cd ../../.. ./devtools/create_project/cmake/create_project . --cmake mkdir build cd build cmake .. cd .. ln -sf build/compile_commands.json compile_commands.json
Now install clangd and open the project. It might be problematic if you have the project already configured with intellisense. So doing a fresh vscode workspace might be better and answering the intellisense questions with no
Another nice option is now to add a .clang-tidy and .clang-format - they are automatically picked up for static code analysis and code formatting in the ide.