| ############################################################################### |
| # 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 = "hello_dts", |
| version = "0.0.1", |
| ) |
| |
| bazel_dep(name = "bazel_skylib", version = "1.7.1") |
| bazel_dep(name = "pigweed") |
| bazel_dep(name = "platforms", version = "0.0.10") |
| bazel_dep(name = "rules_platform", version = "0.1.0") |
| bazel_dep(name = "rules_python", version = "0.40.0") |
| bazel_dep(name = "rules_cc", version = "0.0.17") |
| bazel_dep(name = "zephyr-bazel") |
| bazel_dep(name = "protobuf", version = "29.0") |
| |
| # Module overrides |
| # ================ |
| |
| git_override( |
| module_name = "pigweed", |
| # ROLL: Warning: this entry is automatically updated. |
| # ROLL: Last updated 2025-04-13. |
| # ROLL: By https://cr-buildbucket.appspot.com/build/8717682307174815537. |
| commit = "6fb93eff4e2b4c8d60cb87d5f1c33c6bef22c073", |
| remote = "https://pigweed.googlesource.com/pigweed/pigweed", |
| ) |
| |
| # Toolchain registration |
| # ====================== |
| # Register Pigweed's C++ toolchains. |
| register_toolchains( |
| "@pigweed//pw_toolchain:cc_toolchain_cortex-m0", |
| "@pigweed//pw_toolchain/zephyr/arm:toolchain_cortex-m7", |
| "@pigweed//pw_toolchain:cc_toolchain_cortex-m33", |
| "@pigweed//pw_toolchain/host_clang:host_cc_toolchain_linux", |
| "@pigweed//pw_toolchain/host_clang:host_cc_toolchain_macos", |
| dev_dependency = True, |
| ) |
| |
| local_path_override( |
| module_name = "zephyr-bazel", |
| path = "../..", |
| ) |
| |
| create_zephyr_patch_file = use_repo_rule( |
| "@zephyr-bazel//:setup.bzl", |
| "create_zephyr_patch_file" |
| ) |
| |
| create_zephyr_patch_file( |
| name = "zephyr-patch", |
| filename = "patch.diff", |
| debug = True, |
| ) |
| |
| git_repository = use_repo_rule( |
| "@bazel_tools//tools/build_defs/repo:git.bzl", |
| "git_repository" |
| ) |
| |
| git_repository( |
| name = "zephyr", |
| # Use a local file::// to override the Zephyr git repo and avoid downloads |
| # remote = "file:///path/to/zephyrproject/zephyr" |
| remote = "https://github.com/zephyrproject-rtos/zephyr.git", |
| # ROLL: Warning: this entry is automatically updated. |
| # ROLL: Last updated 2025-03-06. |
| # ROLL: By https://cr-buildbucket.appspot.com/build/8721116211536533505. |
| commit = "fb4bb5d7688f5b232023ea07308edfe734f41b7e", |
| patches = [ |
| "@zephyr-patch//:patch.diff", |
| ], |
| ) |
| |
| create_version_h = use_repo_rule( |
| "@zephyr-bazel//:setup.bzl", |
| "version_header", |
| ) |
| |
| create_version_h( |
| name = "zephyr_version", |
| version_file = "@zephyr//:VERSION", |
| version_template = "@zephyr//:version.h.in", |
| ) |
| |
| new_git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") |
| |
| new_git_repository( |
| name = "hal_atmel", |
| remote = "https://github.com/zephyrproject-rtos/hal_atmel.git", |
| commit = "56d60ebc909ad065bf6554cee73487969857614b", |
| build_file = "@zephyr-bazel//modules:hal_atmel.BUILD" |
| ) |
| |
| new_git_repository( |
| name = "cmsis", |
| remote = "https://github.com/zephyrproject-rtos/cmsis.git", |
| commit = "4b96cbb174678dcd3ca86e11e1f24bc5f8726da0", |
| build_file = "@zephyr-bazel//modules:cmsis.BUILD", |
| ) |
| |
| python = use_extension("@rules_python//python/extensions:python.bzl", "python") |
| python.toolchain( |
| configure_coverage_tool = True, |
| # Only set when you have multiple toolchain versions. |
| is_default = True, |
| python_version = "3.11", |
| ) |
| |
| pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") |
| |
| # Load the Zephyr pip requirements |
| pip.parse( |
| hub_name = "pip", |
| python_version = "3.11", |
| requirements_lock = "@zephyr//:scripts/requirements-base.txt", |
| ) |
| |
| use_repo(pip, "pip") |