File: BUILD.bazel

package info (click to toggle)
pico-sdk 2.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 26,552 kB
  • sloc: ansic: 146,841; asm: 13,423; python: 2,417; cpp: 2,171; yacc: 381; lex: 270; makefile: 32; sh: 13; javascript: 13
file content (63 lines) | stat: -rw-r--r-- 2,148 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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"],
)