Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

I want to get used to bazel build system using clang.

License

NotificationsYou must be signed in to change notification settings

research-note/bazel-clang-cpp-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Here is the summary of what I learned while using bazel build system with cpp & clang 12.

I have build on WSL2 ubuntu 20.04 with Clang-12 Compiler.

Build

Build with Clang-12.

foo@bar:cpp-tutorial/stage1$bazel build --config=clang_config  //main:hello-world

Test

Test withuftrace andvalgrind.

Install uftrace and valgrind in ubuntu.

foo@bar:~$sudo apt -y install uftrace valgrind

uftrace

Test hello-world program with uftrace in terminal.

foo@bar:cpp-tutorial/stage1$uftrace ./bazel-bin/main/hello-world

valgrind

Test hello-world program with valgrind in terminal.

foo@bar:cpp-tutorial/stage1$valgrind ./bazel-bin/main/hello-world

lint

Installcpplint.

foo@bar:~$sudo apt -y install python3&& pip install cpplintfoo@bar:~$echo"export PATH=\$PATH:\$HOME/.local/bin">> .bashrc&&source .bashrc

And do lint.

foo@bar:cpp-tutorial/stage1$cpplint main/hello-world.cc

Reference

Installing Bazel on Ubuntu

Bazel Tutorial: Build a C++ Project

Bazel Tutorial: Configure C++ Toolchains

Bazel command line options

About

I want to get used to bazel build system using clang.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors46


[8]ページ先頭

©2009-2025 Movatter.jp