unplugged-system/build/bazel/rules/hidl/hidl_interface.bzl

49 lines
1.5 KiB
Python

# Copyright (C) 2022 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
load("//build/bazel/rules/cc:cc_hidl_library.bzl", "cc_hidl_library")
load("//build/bazel/rules/hidl:hidl_library.bzl", "hidl_library")
INTERFACE_SUFFIX = "_interface"
def hidl_interface(
name,
srcs = [],
deps = [],
root = "",
root_interface_file = "",
min_sdk_version = "",
tags = []):
"Bazel macro to correspond with the hidl_interface Soong module."
interface_name = name + INTERFACE_SUFFIX
interface_deps = [dep + INTERFACE_SUFFIX for dep in deps]
hidl_library(
name = interface_name,
srcs = srcs,
deps = interface_deps,
fq_name = name,
root = root,
root_interface_file = root_interface_file,
)
cc_hidl_library(
name = name,
interface = interface_name,
dynamic_deps = deps,
min_sdk_version = min_sdk_version,
tags = tags,
)