Hook up pio version string in Bazel build
Some checks failed
Bazel presubmit checks / bazel-build-check (macos-latest) (push) Has been cancelled
Bazel presubmit checks / bazel-build-check (ubuntu-latest) (push) Has been cancelled
Bazel presubmit checks / other-bazel-checks (push) Has been cancelled
Check Configs / check-configs (push) Has been cancelled
CMake / build (push) Has been cancelled

This commit is contained in:
Armando Montanez 2025-07-14 10:30:37 -07:00
parent 14896b6419
commit 485b34ac8d
2 changed files with 18 additions and 1 deletions

View file

@ -1,4 +1,4 @@
load("//bazel:defs.bzl", "compatible_with_rp2")
load("//bazel:defs.bzl", "compatible_with_rp2", "pico_generate_pio_header")
load("//bazel/util:transition.bzl", "kitchen_sink_test_binary")
package(default_visibility = ["//visibility:public"])
@ -21,6 +21,11 @@ cc_library(
includes = ["."],
)
pico_generate_pio_header(
name = "trivial_pio_test",
srcs = ["trivial.pio"],
)
cc_library(
name = "kitchen_sink_common",
testonly = True,

View file

@ -1,3 +1,5 @@
load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
package(default_visibility = ["//visibility:public"])
# TODO: No support for building the parser.
@ -19,6 +21,7 @@ cc_library(
"pio_disassembler.h",
"pio_enums.h",
"pio_types.h",
":version",
],
copts = select({
"@rules_cc//cc/compiler:msvc-cl": ["/std:c++20"],
@ -63,6 +66,15 @@ cc_library(
alwayslink = True,
)
expand_template(
name = "version",
template = "version.h.in",
substitutions = {
"${PIOASM_VERSION_STRING}": module_version() if module_version() != None else "0.0.1-WORKSPACE",
},
out = "gen/version.h",
)
cc_binary(
name = "pioasm",
deps = [