blob: f1bb53bc5c60d5f8de0554acc70750fbeeae32b2 [file] [log] [blame] [edit]
# Copyright 2025 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("//tools/fidl/lib/fidlgentest:fidlgentest_go_test.bzl", "fidlgentest_go_test")
load("@platforms//host:constraints.bzl", "HOST_CONSTRAINTS")
package(default_visibility = ["//visibility:public"])
go_library(
name = "codegen",
srcs = [
"codegen.go",
"ir.go",
],
embedsrcs = [
"alias.tmpl",
"bits.tmpl",
"const.tmpl",
"driver_protocol.tmpl",
"enum.tmpl",
"protocol.tmpl",
"service.tmpl",
"sourcefile.tmpl",
"struct.tmpl",
"table.tmpl",
"union.tmpl",
],
importpath = "go.fuchsia.dev/fuchsia/tools/fidl/fidlgen_rust/codegen",
target_compatible_with = HOST_CONSTRAINTS,
deps = ["//tools/fidl/lib/fidlgen"],
)
fidlgentest_go_test(
name = "fidlgen_rust_lib_tests",
srcs = ["ir_test.go"],
embed = [":codegen"],
target_compatible_with = HOST_CONSTRAINTS,
deps = ["//third_party/golibs:github.com/google/go-cmp/cmp"],
)