Skip to content

Commit bcd2b9d

Browse files
authored
Add Bazel docs (#8510)
1 parent 82fefbf commit bcd2b9d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/source/building.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,20 @@ Once the project files are generated, build as normal for your platform.
7575

7676
## Building with Bazel
7777

78+
You can use [Bazelisk](https://github.com/bazelbuild/bazelisk) to manage your Bazel environment.
79+
For Swift support, you also need Clang and [Swift SDK](https://download.swift.org/).
80+
81+
```sh
82+
curl -sL --fail https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-linux-amd64 -o bazelisk && chmod +x bazelisk
83+
sudo apt install -y clang
84+
SWIFT_VERSION="6.0.3"
85+
curl -L https://download.swift.org/swift-${SWIFT_VERSION}-release/debian12/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-debian12.tar.gz | tar xz
86+
CC=clang PATH=$PATH:$(pwd)/swift-${SWIFT_VERSION}-RELEASE-debian12/usr/bin bazel build //...
87+
CC=clang PATH=$PATH:$(pwd)/swift-${SWIFT_VERSION}-RELEASE-debian12/usr/bin bazel test //...
88+
```
89+
90+
If you are unsure which versions to use, check our CI config at `.bazelci/presubmit.yml`.
91+
7892
## Building with VCPKG
7993

8094
You can download and install flatbuffers using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:

0 commit comments

Comments
 (0)