Bazel Tutorial for C++ in 30 Minutes

Опубликовано: 20 Май 2026
на канале: arisaif
12,463
253

In this video, I will show you how to use Bazel to build your C++ programs.
I cover workspaces, repos, packages, targets, query commands, and many others. I discuss how Bazel BUILD files work and how to build and run your C++ source files.

Link to the repo used in this video:
https://github.com/ourarash/bazel_tut...

A starter template for building CPP files using Bazel:
https://github.com/ourarash/cpp-template
-----------------------------------------------------
Chapters:

Introduction 00:00
Why Bazel? 00:52
Bazel vs Other Build Tools? 3:56
How to use Bazel? 6:25
C++ Build Process 7:25
Creating a Bazel Repo 9:50
Bazel Example 1, Single CPP file: 10:17
The Bazel workspace file structure: 12:21
Bazel query commands: 14:40
Bazel generated files and symlinks 15:46
Example 2, single library file: 16:50
Example 30, multiple library files: 20:18
Visibility of targets in Bazel 21:23
Summary 26:29
A Github template repo for Bazel C++ projects 28:34


-----------------------------------------------------
Let me know if you have any questions in the comments!
-----------------------------------------------------
See my other videos on:
How to use Google Benchmark for C++ Programs:    • How to use Google Benchmark for C++ programs  
Bazel and unit tests with GTest:    • Bazel & Google Test in Visual Studio Code  
Debugging in Visual Studio Code for C++:    • Debugging C++ in Visual Studio Code using ...  
Visual Studio Code, Top Features:    • Visual Studio Code Top Features 2020  
-----------------------------------------------------
Keep in touch with me:
  / ourarash  
  / ourarash  

I'm the founder of BitcoinCrazyness app, the Most Advanced Cryptocurrency mobile APP for alerts, Check it out:

http://www.bitcoincrazyness.com/