| ############################################################################### |
| # Bazel now uses Bzlmod by default to manage external dependencies. |
| # Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. |
| # |
| # For more details, please check https://github.com/bazelbuild/bazel/issues/18958 |
| ############################################################################### |
| module( |
| name = "zephyr-bazel", |
| version = "0.0.1", |
| ) |
| |
| bazel_dep(name = "bazel_skylib", version = "1.7.1") |
| bazel_dep(name = "platforms", version = "0.0.11") |
| bazel_dep(name = "rules_cc", version = "0.1.1") |
| bazel_dep(name = "rules_python", version = "1.8.3") |
| |
| http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| |
| http_archive( |
| name = "zephyr_sdk_xtensa_dc233c", |
| build_file = "//toolchain/xtensa:zephyr_sdk_xtensa_dc233c.BUILD", |
| sha256 = "db5f408c8eccd43fae4dd01ff99dbbb179773132fb239059ef8f836e4a335cd0", |
| strip_prefix = "xtensa-dc233c_zephyr-elf", |
| urls = ["https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.2/toolchain_linux-x86_64_xtensa-dc233c_zephyr-elf.tar.xz"], |
| ) |
| |
| http_archive( |
| name = "zephyr_sdk_arm", |
| build_file = "//toolchain/arm:zephyr_sdk_arm.BUILD", |
| sha256 = "1b61084fe12076a3639aa2d028b5258f41eb3d0f7d46a16264949e1d213f1915", |
| strip_prefix = "arm-zephyr-eabi", |
| urls = ["https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.4/toolchain_linux-x86_64_arm-zephyr-eabi.tar.xz"], |
| ) |
| |
| http_archive( |
| name = "zephyr_sdk_arc", |
| urls = ["https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.4/toolchain_linux-x86_64_arc-zephyr-elf.tar.xz"], |
| sha256 = "f3b627b591a5f5eb86eb8918da2e410bdfa1dd1318de77fb70a6ea4719487370", |
| strip_prefix = "arc-zephyr-elf", |
| build_file = "//toolchain/arc:zephyr_sdk_arc.BUILD", |
| ) |
| |
| http_archive( |
| name = "zephyr_sdk_arm64", |
| urls = ["https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.4/toolchain_linux-x86_64_aarch64-zephyr-elf.tar.xz"], |
| sha256 = "d3c3790cad0b7fe579dc892d7f5e84e07f67008f04f1334ed6f95a3db3f4e608", |
| strip_prefix = "aarch64-zephyr-elf", |
| build_file = "//toolchain/arm64:zephyr_sdk_arm64.BUILD", |
| ) |
| |
| python = use_extension("@rules_python//python/extensions:python.bzl", "python") |
| use_repo(python, "pythons_hub") |
| |
| pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") |
| pip.parse( |
| hub_name = "zephyr_bazel_pip_deps", |
| python_version = "3.11", |
| requirements_lock = "//scripts:requirements-lock.txt", |
| ) |
| pip.parse( |
| hub_name = "zephyr_bazel_pip_deps", |
| python_version = "3.12", |
| requirements_lock = "//scripts:requirements-lock.txt", |
| ) |
| use_repo(pip, "zephyr_bazel_pip_deps") |
| |
| zephyr_patch_file = use_extension("//:setup.bzl", "zephyr_patch_file") |
| zephyr_patch_file.checkout( |
| # The autoroller is broken. Manually update on 2025-12-12. |
| commit = "3568e1b6d5cdd51a6b964a2a1d6d29200fea2056", |
| ) |
| use_repo(zephyr_patch_file, "zephyr", "zephyr_version") |
| |
| zephyr_setup = use_extension("//:setup.bzl", "zephyr_setup") |
| zephyr_setup.env( |
| apps_dirs = ["//:examples"], |
| boards_dirs = ["@zephyr//boards"], |
| ) |
| use_repo( |
| zephyr_setup, |
| "zephyr_index", |
| "zephyr_kconfig", |
| "zephyr_state", |
| ) |
| |
| zephyr_setup_apps = use_extension("//:setup.bzl", "zephyr_setup_apps") |
| # No tags needed, it reads from @zephyr_state |
| |
| bazel_dep(name = "pigweed", dev_dependency = True) |
| git_override( |
| module_name = "pigweed", |
| commit = "d99ea6b4e67c8f91689009aa0dadbbd0f715d5a2", |
| remote = "https://pigweed.googlesource.com/pigweed/pigweed", |
| ) |