CMake does not pass -isystem paths to cppcheck
As a result, if cppcheck
is asked to use Clang for parsing, Clang won't be able to find the headers from -isystem
paths.
$ /path/to/cmake -E __run_co_compile --cppcheck="/path/to/cppcheck;--clang=/path/to/clang" --source=project/source.cxx -- /path/to/compiler -DSOME_DEFINITION -Iproject/include/ -isystem /dependency/include/ -std=c++17 -o ... -c ...
will invoke cppcheck
only with --clang=/path/to/clang -DSOME_DEFINITION -Iproject/include/ project/source.cxx
(there is even no --std=c++17
!) and cppcheck
will invoke clang
as
/path/to/clang -fsyntax-only -Xclang -ast-dump -fno-color-diagnostics -x c++ -Iproject/include/ -DSOME_DEFINITION project/source.cxx
which will fail to find include files from /dependency/include/
(BTW cppcheck
cmdline parser doesn't seem to handle -isystem
)
Edited by languagelawyer