diff --git a/README.md b/README.md index 953b83e..58759e7 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,37 @@ # bazel-cpp-boilerplate + Bazel boilerplate with C++ and GoogleTest. + +## How to build and run + +First, make sure you have [Bazel](https://bazel.build/install) installed. + +```bash +bazel build :all +``` + +```bash +bazel run :hello_main +``` + +## Running the tests + +```bash +bazel test --test_output=all :all +``` + +## Autocomplete with Neovim + +Because we are using Bazel, `clangd` autocomplete in Neovim doesn't know where to find the headers. To fix it, I'm using [Hedron's Compile Commands Extractor for Bazel](https://github.com/hedronvision/bazel-compile-commands-extractor). + +Execute the following command to fix autocomplete when new dependencies are installed: + +``` +bazel run @hedron_compile_commands//:refresh_all +``` + +## Resources + +- [Bazel](https://bazel.build/) as the build tool. +- [Google Test](https://google.github.io/googletest/) for testing. +- [Bazel Compile Commands Extractor](https://github.com/hedronvision/bazel-compile-commands-extractor) to support autocompletion in Neovim and IDEs.