Skip to content

Commit

Permalink
Complete README with instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
andrenbrandao committed Aug 3, 2024
1 parent 3b3449c commit c27582b
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit c27582b

Please sign in to comment.