generator-bazel-cpp
v0.2.1
Published
A generator to generate C++ project using bazel.
Downloads
14
Readme
generator-bazel-cpp
A generator to generate C++ project using bazel.
Installation
Ensure
bazel
exists in your system path. bazelisk is recommended since it also manages bazel versions.
First, install Yeoman and generator-bazel-cpp using npm (we assume you have pre-installed node.js).
npm install -g yo
npm install -g generator-bazel-cpp
Then generate your new project:
yo bazel-cpp
Development
This project uses bazel-compilation-database to generate compile_commands.json
. vscode-clangd is recommended for code completion and navigation.
Once project structure has been changed, run ./gencomp.sh
and restart clangd server in VSCode.
Debug
VSCode Task Shell Input and CodeLLDB extensions are required to debug.
Debug using launch.json
launch.json
has been configured to debug unit tests. To start debugging, just set breaking points and focus on your test file, click Run Debug Test
.
Debug using TestMate
VSCode C++ TestMate is a great tool to run and debug C++ unit tests (including Catch2, GoogleTest).
This project has been configured to adapt the extension. To start running or debugging unit tests, build tests (with VSCode build task or in the terminal) first and then test suites will be shown in the test explorer.
Happy debugging!
License
MIT © ajihyf