Really struggling to find documentation / examples so thought I'd reach out.
My goal: I want clang-tidy to produce a report that I can eventually submit to sonarqube for analysis.
Setting the scene: I have an Android project that's a hybrid of Java and C++ (using JNI). It's legacy C++ that I'm porting (pre-11) and is compiled using CMake throughout the multiple files that make up the project. When editing my code, I can see that clang-tidy is doing a great job of identifying "static" issues as I code, e.g.
clang-tidy at work
Problem: I can't find any specific documentation or examples of how to run clang-tidy, as part of my build. Android Studio is obviously running it via it's "plugin" to highlight "on-the-fly", so it must already be doing what I need - but I just cannot see how to begin to get a report out.
What I've tried:
Desperate for any help here, feel like it's trivial but no-one in my organisation has tried anything like this before.
set(CMAKE_CXX_CLANG_TIDY ${ANDROID_TOOLCHAIN_ROOT}/bin/clang-tidy -checks=*)
works for me with NDK r23 beta 1. I see the tidy failures show up on the command line when I build and don't see the error you mention. Presumably you accidentally used your host's clang-tidy and not the NDK's so it wasn't able to find the NDK headers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With