OCLint

Using OCLint with Bear

This document shows how to apply OCLint to the projects which use Make and other build systems in unix-like operating systems.

Background

Bear is a very handy tool to generate compilation database during the build process. Bear is a very important supplement especially for those who don’t use CMake as build system. Bear can be applied in a wider circumstances, because it injects into the build process, and intercepts the exec calls to understand the compilation details.

Generating compile_commands.json

By following the instructions on Bear README, we could have bear ready to use.

For example, if want to generate the compile_command.json for a project using make, we can easily use bear by

$ /path/to/bear make

What’s Next

The rest of the process is as same as those who use CMake. Please refer to the other document.