...
Code Block | ||
---|---|---|
| ||
$ make $ sudo make install |
Generates a compilation database for clang tooling with Bear
JSON Compilation Database ( compile_commands.json ) is used by clang based tools. For autotools based project (like Traffic Server), Bear is a tool that generates a compilation database.
On macOS or there is a know issue that bear generates empty compilation database because of SIP. Below is instruction to avoid the issue. Assuming above instruction is done. (automake autoconf libtool are already installed).
In short, all building tool chain should not be under certain directories which is protected by SIP.
Code Block | ||
---|---|---|
| ||
$ cp /bin/sh /usr/loca/bin/
$ brew install bear llvm make
$ which clang clang++ gmake
/usr/local/opt/llvm/bin/clang
/usr/local/opt/llvm/bin/clang++
/usr/local/bin/gmake
$ CONFIG_SHELL=/usr/local/bin/sh CC=clang CXX=clang++ ./configure --ADD-OPTIONS-YOU-WANT
$ bear gmake |