-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b3449c
commit c27582b
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |