mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2026-03-14 21:19:43 +01:00
Some checks are pending
Bazel presubmit checks / bazel-build-check (macos-latest) (push) Waiting to run
Bazel presubmit checks / bazel-build-check (ubuntu-latest) (push) Waiting to run
Bazel presubmit checks / other-bazel-checks (push) Waiting to run
Check Configs / check-configs (push) Waiting to run
CMake / build (push) Waiting to run
Build on macOS / build (push) Waiting to run
Build on Windows / build (push) Waiting to run
This is an automated change with the following commands:
$ find . -name "BUILD.bazel" -o -name "*.bzl" \
-exec buildifier -lint=fix {} \;
* Add missing `load()` statements for things provided by @rules_cc. This
is required for Bazel >9.
* Sort attributes on build targets.
* Add missing trailing commas where applicable.
64 lines
2.1 KiB
Text
64 lines
2.1 KiB
Text
load("@rules_cc//cc:cc_library.bzl", "cc_library")
|
|
load("@rules_python//python:defs.bzl", "py_binary")
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
py_binary(
|
|
name = "generate_version_header",
|
|
srcs = ["generate_version_header.py"],
|
|
visibility = ["//:__subpackages__"],
|
|
)
|
|
|
|
# This isn't actually generated, it just uses the same name
|
|
# to make it show up easier in searches.
|
|
#
|
|
# Rather than generating lists of headers to match CMake, the Bazel build
|
|
# opts to have a static header that transitively include two known headers.
|
|
# By default, empty header files are included, and users/platforms are expected
|
|
# to specify an appropriate `cc_library` to replace them.
|
|
#
|
|
# You tell bazel which `cc_library` provides the respective headers by
|
|
# configuring these `label_flag`s:
|
|
#
|
|
# # Specify the library that provides "pico_config_extra_headers.h"
|
|
# --@pico-sdk//bazel/config:PICO_CONFIG_EXTRA_HEADER=//my_proj:my_custom_headers
|
|
#
|
|
# # Specify the library that provides "pico_config_platform_headers.h"
|
|
# --@pico-sdk//bazel/config:PICO_CONFIG_PLATFORM_HEADER=//my_proj:my_custom_platform_headers
|
|
cc_library(
|
|
name = "generate_config_header",
|
|
hdrs = ["include/pico/config_autogen.h"],
|
|
includes = ["include"],
|
|
visibility = ["//:__subpackages__"],
|
|
deps = [
|
|
"//bazel/config:PICO_CONFIG_EXTRA_HEADER",
|
|
"//bazel/config:PICO_CONFIG_PLATFORM_HEADER",
|
|
],
|
|
)
|
|
|
|
genrule(
|
|
name = "empty_extra_headers_file",
|
|
outs = ["generated_extra_include/pico_config_extra_headers.h"],
|
|
cmd = "echo > $@",
|
|
cmd_bat = "copy NUL $@",
|
|
visibility = ["//visibility:private"],
|
|
)
|
|
|
|
cc_library(
|
|
name = "no_extra_headers",
|
|
hdrs = ["generated_extra_include/pico_config_extra_headers.h"],
|
|
includes = ["generated_extra_include"],
|
|
visibility = ["//visibility:private"],
|
|
)
|
|
|
|
# An empty stub, useful for label_flag flags that need to point to a library,
|
|
# but for some purposes the library needs to be a no-op.
|
|
cc_library(
|
|
name = "empty_cc_lib",
|
|
)
|
|
|
|
# A library incompatible with everything. Use to mark an invalid configuration.
|
|
cc_library(
|
|
name = "incompatible_cc_lib",
|
|
target_compatible_with = ["@platforms//:incompatible"],
|
|
)
|