1# Copyright 2025 The Pigweed Authors 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); you may not 4# use this file except in compliance with the License. You may obtain a copy of 5# the License at 6# 7# https://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12# License for the specific language governing permissions and limitations under 13# the License. 14 15load("@rules_cc//cc:cc_library.bzl", "cc_library") 16load("@rules_rust//rust:defs.bzl", "rust_library") 17 18package(default_visibility = ["//visibility:public"]) 19 20rust_library( 21 name = "target_interface", 22 srcs = ["target_interface.rs"], 23) 24 25rust_library( 26 name = "target", 27 srcs = ["target.rs"], 28 deps = [ 29 ":target_backend", 30 ":target_interface", 31 ], 32) 33 34label_flag( 35 name = "target_backend", 36 build_setting_default = ":target_backend_generic", 37) 38 39rust_library( 40 name = "target_backend_generic", 41 srcs = ["target_backend_generic.rs"], 42 crate_name = "target_backend", 43 deps = [ 44 ":target_interface", 45 ], 46) 47 48label_flag( 49 name = "linker_script", 50 build_setting_default = ":no_linker_script", 51) 52 53cc_library( 54 name = "no_linker_script", 55) 56