blob: 7d5965cee87ebced80b90d9a701596e749ac6464 [file] [log] [blame]
# Copyright 2021 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.
import("//build/components/fuchsia_package.gni")
import("//build/drivers/driver_manifest.gni")
# Defines a Fuchsia driver package.
# A fuchsia_driver_package is a fuchsia_package but with extra
# metadata so that the drivers inside the package can be collected into a
# Driver Manifest. Normally, these packages will be included in the base_driver_package
# list and included in the Base Driver Manifest.
#
# A driver is a shared library that's placed in the /driver/ directory of the package.
# Drivers are normally built with the `driver_module` build target.
#
# The fuchsia_driver_package does not need to contain any components, although
# components placed in the package will behave normally.
#
# For more information on a fuchsia_package see:
# //build/components/fuchsia_package.gni
#
# Parameters:
#
# package_name (optional)
# The name of the package.
# Type: string
# Default: target_name
#
# disable_elf_binaries_checks (optional)
# Set to true to disable ELF binaries verification checks. Useful
# if your package includes non-Fuchsia ELF binaries, or if some
# of them are unstripped.
# Type: boolean
# Default: false
#
# deps
# testonly
# visibility
template("fuchsia_driver_package") {
package_name = target_name
if (defined(invoker.package_name)) {
package_name = invoker.package_name
}
driver_manifest_target = "${target_name}_driver_manifest"
driver_manifest(driver_manifest_target) {
forward_variables_from(invoker,
[
"testonly",
"deps",
])
package_url = "fuchsia-pkg://fuchsia.com/${package_name}"
# We don't want individual package's driver manifests to end up in the image.
# Instead these files will be collected by one `combined_driver_manifest` target.
install_as_config_resource = false
}
fuchsia_package(target_name) {
forward_variables_from(invoker, "*")
if (!defined(deps)) {
deps = []
}
deps += [ ":${driver_manifest_target}" ]
}
}