Lines Matching +full:bazel +full:- +full:build +full:- +full:check
1 # Bazel build
3 ## Using the Pico SDK in a Bazel project.
5 ### Add pico-sdk as a dependency
6 First, in your `MODULE.bazel` file, add a dependency on the Pico SDK and
9 bazel_dep(name = "pico-sdk", version = "2.1.0")
13 These toolchains tell Bazel how to compile for ARM cores. Add the following
14 to the `MODULE.bazel` for your project:
17 "@pico-sdk//bazel/toolchain:linux-x86_64-rp2040",
18 "@pico-sdk//bazel/toolchain:linux-x86_64-rp2350",
19 "@pico-sdk//bazel/toolchain:win-x86_64-rp2040",
20 "@pico-sdk//bazel/toolchain:win-x86_64-rp2350",
21 "@pico-sdk//bazel/toolchain:mac-x86_64-rp2040",
22 "@pico-sdk//bazel/toolchain:mac-x86_64-rp2350",
23 "@pico-sdk//bazel/toolchain:mac-aarch64-rp2040",
24 "@pico-sdk//bazel/toolchain:mac-aarch64-rp2350",
28 ### Ready to build!
29 You're now ready to start building Pico Projects in Bazel! When building,
30 don't forget to specify `--platforms` so Bazel knows you're targeting the
33 $ bazelisk build --platforms=@pico-sdk//bazel/platform:rp2040 //...
37 An exhaustive list of build system configuration options is available in
38 `//bazel/config:BUILD.bazel`.
41 A different board can be selected specifying `--@pico-sdk//bazel/config:PICO_BOARD`:
43 $ bazelisk build --platforms=//bazel/platform:rp2040 --@pico-sdk//bazel/config:PICO_BOARD=pico_w //…
47 by pointing `--@pico-sdk//bazel/config:PICO_CONFIG_HEADER` to a `cc_library`
53 Creation of UF2 images can be done as explicit build steps on a per-binary
54 rule basis, or through an aspect. Running a wildcard build with the
59 $ bazelisk build --platforms=@pico-sdk//bazel/platform:rp2040 \
60 --aspects @pico-sdk//tools:uf2_aspect.bzl%pico_uf2_aspect \
61 --output_groups=+pico_uf2_files \
68 You'll need Bazel (v7.0.0 or higher) or Bazelisk (a self-updating Bazel
69 launcher) to build the Pico SDK.
72 [Bazelisk](https://bazel.build/install/bazelisk).
74 You will also need a working compiler configured if you wish to build Picotool
77 * Linux: `sudo apt-get install build-essential` or similar.
78 * macOS: `xcode-select --install`
82 To build all of the Pico SDK, run the following command:
84 $ bazelisk build --platforms=//bazel/platform:rp2040 //...
88 The Bazel build for the Pico SDK is relatively new, but most features and
89 configuration options available in the CMake build are also available in Bazel.
96 the CMake build.
97 * Bazel does not yet provide RISC-V support for Pico 2/RP2350.
98 * The pioasm parser cannot be built from source via Bazel.
99 * Windows MSVC wildcard build (`bazel build //...`) does not work when targeting
103 When making changes to the Bazel build, please run the Bazel validation script
104 to ensure all supported configurations build properly:
110 If you need to check against a local version of Picotool, you can run the script
111 with `--picotool-dir`:
114 $ ./tools/run_all_bazel_checks.py --picotool-dir=/path/to/picotool