| # Copyright 2026 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| load("@io_bazel_rules_go//go:def.bzl", "go_library") |
| load("@platforms//host:constraints.bzl", "HOST_CONSTRAINTS") |
| load("//build/bazel/rules/host:defs.bzl", "go_binary_host_tool") |
| |
| package(default_applicable_licenses = ["//:license"]) |
| |
| go_library( |
| name = "codegen", |
| srcs = [ |
| "codegen/codegen.go", |
| "codegen/ir.go", |
| ], |
| embedsrcs = [ |
| "codegen/bits.tmpl", |
| "codegen/enum.tmpl", |
| "codegen/protocol.tmpl", |
| "codegen/sourcefile.tmpl", |
| "codegen/struct.tmpl", |
| "codegen/table.tmpl", |
| "codegen/union.tmpl", |
| ], |
| importpath = "go.fuchsia.dev/fuchsia/tools/fidl/fidlgen_python/codegen", |
| target_compatible_with = HOST_CONSTRAINTS, |
| deps = ["//tools/fidl/lib/fidlgen"], |
| ) |
| |
| go_binary_host_tool( |
| name = "fidlgen_python", |
| srcs = ["main.go"], |
| target_compatible_with = HOST_CONSTRAINTS, |
| deps = [ |
| ":codegen", |
| "//tools/fidl/lib/fidlgen", |
| ], |
| ) |