Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CREATE_PROJECT: export compile_commands.json via cmake #2525

merged 2 commits into from Oct 19, 2020


Copy link

@mgerhardy mgerhardy commented Oct 14, 2020

This is useful for e.g. clangd or other clang based tools like the analyser.

I'm using the generated compile_commands.json with clangd and vscode (the file must be located in the project root to be found automatically by clangd)

Install the clangd plugin for vscode, execute cmake, copy the your_build_dir/compile_commands.json to scummvmcheckout/compile_commands.json and execute Restart clangd in vscode.

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

Bildschirmfoto von 2020-10-14 16-49-11

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.

Bildschirmfoto von 2020-10-14 16-57-24

Copy link

@deepcode-ci-bot deepcode-ci-bot bot commented Oct 14, 2020

DeepCode's analysis on #a7654b found:

  • ⚠️ 1 warning 👇

Top issues

Description Example fixes
Missing check is_open on std::ofstream before writing to it. Occurrences: 🔧 Example fixes

👉 View analysis in DeepCode’s Dashboard | Configure the bot

mgerhardy added 2 commits Oct 14, 2020
this is useful for e.g. clangd or other clang based tools like the analyser
@mgerhardy mgerhardy force-pushed the mgerhardy:pr/cmake-compile-commands branch from 2af3060 to a7654b4 Oct 19, 2020
Copy link

@sev- sev- commented Oct 19, 2020


@sev- sev- merged commit 813b497 into scummvm:master Oct 19, 2020
1 of 2 checks passed
1 of 2 checks passed
deepcode-ci-bot Found 1 warning issue.
continuous-integration/travis-ci/pr The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.