Using Clang Analyzer with cmake¶
Download/Compile from http://clang-analyzer.llvm.org/
Add it to your path (or install it):
Locate scan-build and ccc-analyzer, for example /opt/llvm/tools/clang/utils/scan-build and /opt/llvm/tools/clang/utils/ccc-analyzer.
Configure your cmake build (start in source directory):
mkdir clangbuild cd clangbuild cmake -DCMAKE_C_COMPILER=/opt/llvm/tools/clang/utils/ccc-analyzer ..
#!/bin/bash export PATH="/opt/llvm/Debug/bin:$PATH" cmake -DCMAKE_C_COMPILER=/opt/llvm/tools/clang/utils/ccc-analyzer "$@"
#!/bin/bash export PATH="/opt/llvm/Debug/bin:$PATH" /opt/llvm/tools/clang/utils/scan-build make "$@"
Updated by stbuehler almost 7 years ago · 2 revisions