Specify defines and includes as compilation options (after --)

clang-tidy

  • An LLVM-based C/C++ linter to find style violations, bugs and security flaws through static analysis.
    More information: <https://clang.llvm.org/extra/clang-tidy/>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

clang-tidy {{path/to/file.cpp}} -- -I{{my_project/include}} -D{{definitions}}

click the source code to copy install clang-tidy on any operating system with command-not-found.com