blob: 42acfd409a8fae6f08bfb7675774f026446f67c0 [file] [log] [blame]
# Copyright 2018 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.
# Definitions to build each of the Fuchsia SDKs.
import("//build/config/build_api_module.gni")
import("//build/dart/toolchain.gni")
import("//build/fidl/toolchain.gni")
import("//build/sdk/merged_sdk.gni")
import("//build/sdk/sdk.gni")
import("//build/sdk/sdk_documentation.gni")
import("//build/sdk/version_history_sdk_element.gni")
import("//sdk/cts/build/cts_sdk.gni")
import("config.gni")
_sdk_public_deps = [
":core",
":core_testing",
":e2e_testing",
":modular_testing",
":zircon_sysroot",
]
# This default target should contain all public or partner SDKs.
# Any public or partner SDKs added to this target should also be
# added to ALLOWED_CTS_SDKS in //sdk/cts/build/allowed_cts_deps.gni.
group("sdk") {
testonly = true
public_deps = _sdk_public_deps
data_deps = [ ":sdk_source_set_list" ]
}
# This file contains the list of all source files used in sdk_source_set()
# targets reachable from //sdk:sdk. The schema is simply a JSON list, where
# each item is the path to a single source file, relative to the source
# directory. Path are not sorted and appear in order of metadata walk, which
# is unstable.
build_api_module("sdk_source_set_list") {
testonly = true
data_keys = [ "sdk_source_set_sources" ]
deps = _sdk_public_deps
}
# Create generated file for fidldoc to read.
generated_file("all_fidl_sdk_json") {
deps = [ "//sdk/fidl" ]
outputs = [ "$root_build_dir/all_fidl_sdk_json.txt" ]
data_keys = [ "fidl_json" ]
}
# Compatibility testing goldens for SDK publishable FIDLs.
# This is a list of scopes like { src = "", dst = "" } specifying which files
# to copy from the build directory into the source tree.
generated_file("compatibility_testing_goldens") {
testonly = true
deps = [ "//sdk" ]
outputs = [ "$root_build_dir/compatibility_testing_goldens.json" ]
output_conversion = "json"
data_keys = [ "compatibility_testing_goldens" ]
}
# TODO(96110): Remove this and use //sdk/cts:plasa_manifest.
# Contains the list of all plasa fragment files, which have a dump of the
# public API surfaces.
generated_file("plasa") {
testonly = true
data_keys = [ "plasa" ]
outputs = [ "$root_build_dir/manifest.plasa.json" ]
output_conversion = "json"
deps = _sdk_public_deps + [ "//sdk/cts/plasa:vdso_summary" ]
}
# This target is used by infra builders to build all SDK archives that
# make up the "core" SDK.
group("archives") {
testonly = true
public_deps = [
":core_archive",
":core_testing_archive",
":e2e_testing_archive",
":fuchsia_dart_archive",
":modular_testing_archive",
]
}
merged_sdk("merged") {
testonly = true
deps = [
":core",
":core_testing",
":e2e_testing",
":fuchsia_dart",
":modular_testing",
]
}
group("sdk.modular") {
testonly = true
public_deps = [
":core.modular",
":host_tools.all",
":modular_testing",
":zircon_sysroot",
"//scripts/sdk/gn:gn.modular.tar.gz",
]
}
group("tests_no_e2e") {
testonly = true
assert_no_deps = e2e_test_libs
deps = [
"cts/plasa:tests",
"dart:tests",
"lib:tests",
]
}
group("tests") {
testonly = true
deps = [
":tests_no_e2e",
# `testing:tests` contains unit tests for sl4f, which depend on sl4f so it
# can't live inside `test_no_e2e`.
"testing:tests",
]
}
version_history_sdk_element("version_history_sdk_element") {
schema = "//build/sdk/meta/version_history-ef02ef45.json"
data = "version_history.json"
}
sdk_element_adapter("version_history") {
deps = [ ":version_history_sdk_element" ]
}
# License/rights related information for the SDK.
sdk_documentation("open_source") {
name = "open_source"
category = "public"
files = []
foreach(file,
[
"AUTHORS",
"LICENSE",
"PATENTS",
]) {
files += [
{
source = "//$file"
dest = file
},
]
}
}
# Licensing information for the 'libc'-style musl library.
sdk_documentation("musl_license") {
name = "musl_license"
category = "public"
files = [
{
source = "//zircon/third_party/ulib/musl/COPYRIGHT"
dest = "COPYRIGHT.musl"
},
]
}
# Notice file for all contents in the Fuchsia SDK.
# TODO(fxb/102264): Replace this with individual notices for each SDK element.
sdk_documentation("sdk_notice") {
name = "sdk_notice"
category = "public"
files = [
{
source = "//tools/check-licenses/golden/sdk/NOTICE.fuchsia"
dest = "NOTICE.fuchsia"
},
]
}
cts_sdk("cts") {
testonly = true
category = "cts"
deps = [
":license",
"cts:cts_tests",
"cts:plasa",
]
}
# License/copyright files for the SDK.
sdk_molecule("license") {
visibility = [ ":*" ]
deps = [
":musl_license",
":open_source",
":sdk_notice",
]
}
sdk("zircon_sysroot") {
category = "internal"
deps = [ "//zircon/public/sysroot/sdk:sysroot_sdk" ]
}
sdk("e2e_testing") {
# TODO(fxbug.dev/6128): this id should not be necessary.
id = sdk_id
category = "partner"
api = "manifests/e2e_testing.manifest"
deps = [
":e2e_testing_tools",
"//sdk/testing/sl4f/client:client_sdk($dart_toolchain)",
]
}
sdk_molecule("e2e_testing_tools") {
visibility = [ ":*" ]
deps = [
"//src/performance/trace2json:bin_sdk($host_toolchain)",
"//src/sys/pkg/testing/fake-omaha-client:bin_sdk($host_toolchain)",
]
}
# Tools and data used on a 'host' development machine; where host is often
# Linux or Mac OS.
sdk_molecule("host_tools") {
visibility = [ ":*" ]
cross_compiled = [
"//tools/fidl/fidlgen_hlcpp:fidlgen_sdk",
"//tools/cmc:cmc_sdk",
"//tools/fvdl:fvdl_sdk",
"//tools/sdk-tools/fconfig:fconfig_sdk",
"//tools/sdk-tools/fpublish:fpublish_sdk",
"//tools/sdk-tools/fserve:fserve_sdk",
"//tools/sdk-tools/fssh:fssh_sdk",
"//src/developer/debug/zxdb:zxdb_sdk",
"//src/developer/ffx:bin_sdk",
"//src/storage/bin/fvm:fvm_sdk",
"//src/storage/tools/blobfs-compression:blobfs-compression_sdk",
"//src/sys/pkg/bin/far:bin_sdk",
"//src/sys/pkg/bin/pm:pm_bin_sdk",
"//tools/bootserver_old:bootserver_sdk",
"//tools/net/device-finder:device-finder_sdk",
"//tools/symbol-index:symbol_index_sdk",
"//tools/symbolizer:sdk",
"//tools/fidl/fidlc:fidl-format_sdk",
"//tools/fidl/fidlc:fidlc_sdk",
"//tools/fidlcat:fidlcat_sdk",
"//zircon/tools/blobfs:blobfs_sdk",
"//zircon/tools/merkleroot:merkleroot_sdk",
"//zircon/tools/minfs:minfs_sdk",
"//zircon/tools/zbi:zbi_sdk",
# TODO(https://fxbug.dev/95661): Remove these once the emulators are available independently.
"//src/developer/ffx/plugins/emulator:aemu_internal",
"//src/developer/ffx/plugins/emulator:qemu_internal",
]
toolchains = []
if (host_os == "linux") {
toolchains += [
host_x64_toolchain,
host_arm64_toolchain,
]
} else if (host_os == "mac") {
toolchains += [ host_toolchain ]
}
deps = []
foreach(toolchain, toolchains) {
foreach(dep, cross_compiled) {
deps += [ "$dep($toolchain)" ]
if (toolchain == host_toolchain) {
deps += [ "${dep}_legacy($toolchain)" ]
}
}
}
}
sdk_molecule("core_lib") {
visibility = [ ":*" ]
deps = [
"//sdk/lib/fdio:fdio_sdk",
"//sdk/lib/fidl/cpp:cpp_sdk",
"//sdk/lib/fit-promise:fit-promise_sdk",
"//sdk/lib/inspect",
"//sdk/lib/inspect/service/cpp:cpp_sdk",
"//sdk/lib/media/cpp:cpp_sdk",
"//sdk/lib/modular/cpp:cpp_sdk",
"//sdk/lib/stdcompat:stdcompat_sdk",
"//sdk/lib/svc:svc_sdk",
"//sdk/lib/sys/component:realm_builder_shard_sdk",
"//sdk/lib/sys/cpp:cpp_sdk",
"//sdk/lib/sys/inspect/cpp:cpp_sdk",
"//sdk/lib/sys/testing:testing_sdk",
"//sdk/lib/syslog",
"//sdk/lib/syslog/structured_backend:structured_backend_sdk",
"//sdk/lib/ui/scenic/cpp:cpp_sdk",
"//sdk/lib/vfs/cpp:cpp_sdk",
"//sdk/lib/vulkan",
"//src/storage/memfs:memfs_sdk",
"//zircon/system/ulib/async:async-cpp_sdk",
"//zircon/system/ulib/async:async_sdk",
"//zircon/system/ulib/async-default:async-default_sdk",
"//zircon/system/ulib/async-loop:async-loop-cpp_sdk",
"//zircon/system/ulib/async-loop:async-loop-default_sdk",
"//zircon/system/ulib/async-loop:async-loop_sdk",
"//zircon/system/ulib/async-loop/testing:async-loop-testing_sdk",
"//zircon/system/ulib/inspect:inspect_sdk",
"//zircon/system/ulib/sync:sync_sdk",
"//zircon/system/ulib/syslog:syslog_sdk",
"//zircon/system/ulib/trace:trace_sdk",
"//zircon/system/ulib/trace-engine:trace-engine_sdk",
"//zircon/system/ulib/trace-provider:trace-provider-so_sdk",
]
}
# Pieces of the IDK sans host tools (which are in ":host_tools").
sdk_molecule("core_idk") {
visibility = [ ":*" ]
deps = [
":core_lib",
":license",
":version_history",
"devices",
"docs",
"//sdk/fidl",
"//src/lib/vulkan:vulkan_layers",
"//third_party/Vulkan-Loader:libvulkan_sdk",
"//third_party/Vulkan-Loader:vulkan_license",
"//zircon/public/sysroot/sdk:sysroot_sdk",
]
}
sdk_molecule("core_testing_idk") {
visibility = [ ":*" ]
testonly = true
deps = [
"//sdk/fidl:fidl_testing",
"//sdk/lib/sys/component/cpp/testing:cpp_library_sdk",
"//sdk/lib/sys/cpp/testing:cpp_sdk",
"//tools/docsgen:ref_docs_sdk",
"//zircon/system/ulib/async-testing:async-testing_sdk",
]
}
sdk("core") {
id = sdk_id
category = "partner"
api = "manifests/core.manifest"
deps = [
":core_idk",
":host_tools",
]
}
sdk("core_testing") {
id = sdk_id
testonly = true
category = "partner"
api = "manifests/core_testing.manifest"
deps = [ ":core_testing_idk" ]
}
sdk("core.modular") {
id = sdk_id
category = "partner"
api = "manifests/core.modular.manifest"
testonly = true
deps = [ ":core_idk" ]
}
group("host_tools.all") {
public_deps = []
if (host_os == "linux") {
public_deps += [
":host_tools.modular($host_arm64_toolchain)",
":host_tools.modular($host_x64_toolchain)",
]
} else if (host_os == "mac") {
public_deps += [ ":host_tools.modular($host_toolchain)" ]
}
}
if (is_host) {
sdk("host_tools.modular") {
id = sdk_id
category = "partner"
api = "manifests/host_tools_${current_os}_${current_cpu}.manifest"
deps = [
"//src/developer/debug/zxdb:zxdb_sdk",
"//src/developer/ffx:bin_sdk",
"//src/storage/bin/fvm:fvm_sdk",
"//src/storage/tools/blobfs-compression:blobfs-compression_sdk",
"//src/sys/pkg/bin/far:bin_sdk",
"//src/sys/pkg/bin/pm:pm_bin_sdk",
"//tools/bootserver_old:bootserver_sdk",
"//tools/cmc:cmc_sdk",
"//tools/fidl/fidlc:fidl-format_sdk",
"//tools/fidl/fidlc:fidlc_sdk",
"//tools/fidl/fidlgen_hlcpp:fidlgen_sdk",
"//tools/fidlcat:fidlcat_sdk",
"//tools/fvdl:fvdl_sdk",
"//tools/net/device-finder:device-finder_sdk",
"//tools/symbol-index:symbol_index_sdk",
"//tools/symbolizer:sdk",
"//zircon/tools/blobfs:blobfs_sdk",
"//zircon/tools/merkleroot:merkleroot_sdk",
"//zircon/tools/minfs:minfs_sdk",
"//zircon/tools/zbi:zbi_sdk",
]
}
}
# The `modular_testing` SDK provides FIDL protocols and C++ libraries for writing hermetic
# integration tests which use modular.
#
# The modular framework is deprecated: new products should use the session framework
# instead. See //docs/concepts/session/introduction.md.
#
# This SDK has runtime dependencies on the following fuchsia packages:
# * environment_delegating_runner
# * modular_test_harness
sdk("modular_testing") {
testonly = true
id = sdk_id
api = "manifests/modular_testing.manifest"
category = "partner"
deps = [
"//sdk/fidl/fuchsia.element:fuchsia.element_sdk($fidl_toolchain)",
"//sdk/fidl/fuchsia.modular:fuchsia.modular_sdk($fidl_toolchain)",
"//sdk/fidl/fuchsia.modular.testing:fuchsia.modular.testing_sdk($fidl_toolchain)",
"//sdk/fidl/fuchsia.ui.lifecycle:fuchsia.ui.lifecycle_sdk($fidl_toolchain)",
"//sdk/lib/modular/testing/cpp:cpp_sdk",
]
}
# Firmware SDK.
sdk("firmware") {
category = "experimental"
deps = [
"//sdk/docs:firmware",
"//src/firmware/lib/abr:abr_sdk",
"//src/firmware/lib/zbi:zbi_sdk",
"//src/firmware/lib/zircon_boot:zircon_boot_sdk",
"//third_party/android/platform/external/avb:avb_sdk",
"//zircon/public/sysroot/sdk:sysroot_sdk",
]
}
# Tools and libraries to develop for Fuchsia with Dart.
sdk("fuchsia_dart") {
category = "partner"
id = sdk_id
api = "manifests/fuchsia_dart.manifest"
deps = [
"//sdk/dart:gen_snapshot_sdk($dart_toolchain)",
"//sdk/dart:kernel_compiler_sdk($dart_toolchain)",
"//sdk/docs:modular_config_schema",
# TODO(leetodd): remove, needed to soft transition
# https://fuchsia-review.googlesource.com/c/fuchsia/+/399537
"//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_sdk",
# TODO(viktard): remove, needed to soft transition
# https://fuchsia-review.googlesource.com/c/fuchsia/+/295264
"//sdk/fidl/fuchsia.ui.app:fuchsia.ui.app_sdk",
# TODO(fxbug.dev/24537): Remove this temporary dependency.
# Temporarily added as a direct dependency so that it can be removed from
# //sdk/fidl/fuchsia.ui.views.
"//sdk/fidl/fuchsia.intl:fuchsia.intl_sdk",
# Direct FIDL deps.
# If a FIDL deps is part of the SDK, it should be explicitly listed here.
"//sdk/dart/fidl:fidl_sdk($dart_toolchain)",
"//sdk/dart/fuchsia:fuchsia_sdk($dart_toolchain)",
"//sdk/dart/fuchsia_component_test:fuchsia_component_test_sdk($dart_toolchain)",
"//sdk/dart/fuchsia_inspect:fuchsia_inspect_sdk($dart_toolchain)",
"//sdk/dart/fuchsia_logger:fuchsia_logger_sdk($dart_toolchain)",
"//sdk/dart/fuchsia_modular:fuchsia_modular_sdk($dart_toolchain)",
"//sdk/dart/fuchsia_modular_testing:fuchsia_modular_testing_sdk($dart_toolchain)",
"//sdk/dart/fuchsia_scenic:fuchsia_scenic_sdk($dart_toolchain)",
"//sdk/dart/fuchsia_scenic_flutter:fuchsia_scenic_flutter_sdk($dart_toolchain)",
"//sdk/dart/fuchsia_services:fuchsia_services_sdk($dart_toolchain)",
"//sdk/dart/fuchsia_vfs:fuchsia_vfs_sdk($dart_toolchain)",
"//sdk/fidl/fuchsia.element:fuchsia.element_sdk",
"//sdk/fidl/fuchsia.hardware.audio:fuchsia.hardware.audio_sdk",
"//tools/fidl/fidlgen_dart:fidlgen_dart_sdk_legacy($host_toolchain)",
]
toolchains = []
if (host_os == "linux") {
toolchains += [
host_x64_toolchain,
host_arm64_toolchain,
]
} else if (host_os == "mac") {
toolchains += [ host_toolchain ]
}
foreach(toolchain, toolchains) {
deps += [ "//tools/fidl/fidlgen_dart:fidlgen_dart_sdk($toolchain)" ]
}
}
# Tools Fuchsia driver developers used on the host platform; where host is often
# Linux or Mac OS.
sdk_molecule("ddk_host_tools") {
visibility = [ ":*" ]
cross_compiled = [
"//src/devices/tools/fidlgen_banjo:fidlgen_banjo_bin_sdk",
"//tools/bindc:bindc_sdk",
"//tools/fidl/fidlgen_cpp:fidlgen_cpp_sdk",
]
toolchains = []
if (host_os == "linux") {
toolchains += [
host_x64_toolchain,
host_arm64_toolchain,
]
} else if (host_os == "mac") {
toolchains += [ host_toolchain ]
}
deps = []
foreach(toolchain, toolchains) {
foreach(dep, cross_compiled) {
deps += [ "$dep($toolchain)" ]
if (toolchain == host_toolchain) {
deps += [ "${dep}_legacy($toolchain)" ]
}
}
}
}
sdk_molecule("bind") {
visibility = [ ":*" ]
deps = [
"//src/devices/bind/fuchsia.acpi:fuchsia.acpi_sdk",
"//src/devices/bind/fuchsia.i2c:fuchsia.i2c_sdk",
"//src/devices/bind/fuchsia.pci:fuchsia.pci_sdk",
"//src/devices/bind/fuchsia.test:fuchsia.test_sdk",
"//src/devices/bind/fuchsia.usb:fuchsia.usb_sdk",
]
}
sdk_molecule("ddk_fidl") {
visibility = [ ":*" ]
deps = [
"//sdk/fidl/fuchsia.device.fs:fuchsia.device.fs_sdk($fidl_toolchain)",
"//sdk/fidl/fuchsia.driver.compat:fuchsia.driver.compat_sdk($fidl_toolchain)",
"//sdk/fidl/fuchsia.driver.framework:fuchsia.driver.framework_sdk($fidl_toolchain)",
"//sdk/fidl/fuchsia.hardware.acpi:fuchsia.hardware.acpi_sdk($fidl_toolchain)",
"//sdk/fidl/fuchsia.hardware.ftdi:fuchsia.hardware.ftdi_sdk($fidl_toolchain)",
"//sdk/fidl/fuchsia.hardware.i2c:fuchsia.hardware.i2c_sdk($fidl_toolchain)",
"//sdk/fidl/fuchsia.hardware.pci:fuchsia.hardware.pci_sdk($fidl_toolchain)",
"//sdk/fidl/fuchsia.wlan.common:fuchsia.wlan.common_sdk($fidl_toolchain)",
"//sdk/fidl/fuchsia.wlan.ieee80211:fuchsia.wlan.ieee80211_sdk($fidl_toolchain)",
"//sdk/fidl/fuchsia.wlan.internal:fuchsia.wlan.internal_sdk($fidl_toolchain)",
"//sdk/fidl/fuchsia.wlan.internal:fuchsia.wlan.internal_sdk($fidl_toolchain)",
]
}
# An experimental SDK for developing drivers.
sdk("ddk") {
id = sdk_id
category = "experimental"
api = "manifests/ddk.manifest"
deps = [
":bind",
":ddk_fidl",
":ddk_host_tools",
"//sdk/lib/driver2:llcpp_sdk",
"//sdk/lib/driver_runtime:driver_runtime_cpp_sdk",
"//sdk/lib/driver_runtime:driver_runtime_sdk",
"//sdk/lib/fidl/cpp/wire:wire_sdk",
"//sdk/lib/input_report_reader:input_report_reader_sdk",
"//sdk/lib/sys/component/llcpp:llcpp_sdk",
"//src/devices/bin/driver_runtime:driver_runtime_sdk",
"//src/devices/lib/mmio:mmio_sdk",
"//zircon/system/ulib/hwreg:hwreg_sdk_sdk",
]
}