[llvm] [bazel][docs] Update build documentation (PR #99339)

Angel Zhang via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 17 08:23:00 PDT 2024


https://github.com/angelz913 updated https://github.com/llvm/llvm-project/pull/99339

>From 8b35131c7cf85f6ee29c018967851b8a048e2ddb Mon Sep 17 00:00:00 2001
From: Angel Zhang <angel.zhang at amd.com>
Date: Wed, 17 Jul 2024 15:14:52 +0000
Subject: [PATCH] [bazel][docs] Update build documentation

---
 utils/bazel/README.md | 34 +++++++++++++++++++++++++---------
 1 file changed, 25 insertions(+), 9 deletions(-)

diff --git a/utils/bazel/README.md b/utils/bazel/README.md
index 16d736852d130..d3e7f15f17683 100644
--- a/utils/bazel/README.md
+++ b/utils/bazel/README.md
@@ -33,15 +33,31 @@ for adding this configuration.
      [bazelisk](https://github.com/bazelbuild/bazelisk) which automates
      downloading the proper bazel version
 3. `cd utils/bazel`
-4. `bazel build --config=generic_clang @llvm-project//...`
-   * If you're using clang, it's expected that lld is also available
-   * If you're using MSVC or gcc, instead of `--config=generic_clang`, pass
-   `--config=generic_gcc` or `--config=msvc`
-   * To specify a specific local compiler to use, add the following bazel
-     flag: `--repo_env=CC=/usr/bin/clang`
-     * `--config=generic_clang`/`--config=generic_gcc` by default set
-       `--repo_env=CC=clang`/`--repo_env=CC=gcc`, using `clang`/`gcc` on the
-       `PATH`
+4. The `bazel build` command depends on the local compiler you want to use.
+   * For **clang**, go to step 5.
+   * For **gcc** or **MSVC**, go to step 6
+5. If you are using **clang**, it is expected that lld is also available.
+   The `--config=generic_clang` flag by default sets the compiler to be `clang`
+   binary on the `PATH`.
+   ```
+   bazel build --config=generic_clang @llvm-project//...
+   ```
+   To provide a specific path to your `clang`, use the `--repo_env` Bazel flag.
+   For example:
+   ```
+   bazel build --config=generic_clang --repo_env=CC=/usr/bin/clang --repo_env=CXX=/usr/bin/clang++  @llvm-project//...
+   ```
+6. If you are using **gcc** or **MSVC**, instead of `--config=generic_clang`
+   , pass `--config=generic_gcc` or `--config=generic_msvc`, which sets the
+   compiler to be `gcc` binary on the `PATH`.
+   ```
+   bazel build --config=generic_gcc @llvm-project//...
+   ```
+   To provide a specific path to your `gcc`, use the `--repo_env` Bazel flag.
+   For example:
+   ```
+   bazel build --config=generic_gcc --repo_env=CC=/usr/bin/gcc --repo_env=CXX=/usr/bin/g++  @llvm-project//...
+   ```
 
 # Configuration
 



More information about the llvm-commits mailing list