blob: 6a3f1e2127e1549b8e924df2006158ffb7c65cb9 [file] [log] [blame]
# Copyright 2019 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/config/fuchsia/rules.gni")
import("//build/test.gni")
import("//build/test/test_package.gni")
group("tests") {
testonly = true
deps = [ ":sysmem-unittest" ]
}
source_set("sysmem_common_srcs") {
sources = [
"allocator.cc",
"buffer_collection.cc",
"buffer_collection_token.cc",
"contiguous_pooled_memory_allocator.cc",
"device.cc",
"driver.cc",
"koid_util.cc",
"logging.cc",
"logical_buffer_collection.cc",
"memory_allocator.cc",
"usage_pixel_format_cost.cc",
"utils.cc",
]
public_deps = [
"//sdk/banjo/ddk.protocol.platform.bus",
"//sdk/banjo/ddk.protocol.platform.device",
"//sdk/banjo/ddk.protocol.sysmem",
"//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_c",
"//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_llcpp",
"//sdk/fidl/fuchsia.sysmem2:fuchsia.sysmem2_llcpp",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/public/lib/async-cpp",
"//zircon/public/lib/fbl",
"//zircon/public/lib/fidl",
"//zircon/public/lib/fit",
"//zircon/public/lib/sync",
"//zircon/public/lib/zx",
"//zircon/public/lib/zx",
"//zircon/system/ulib/async-default",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/closure-queue",
"//zircon/system/ulib/fidl-async-2",
"//zircon/system/ulib/fidl-utils",
"//zircon/system/ulib/image-format",
"//zircon/system/ulib/inspect",
"//zircon/system/ulib/region-alloc",
"//zircon/system/ulib/trace:trace-driver",
]
deps = [
"//zircon/system/ulib/closure-queue",
"//zircon/system/ulib/fidl-async-2",
"//zircon/system/ulib/fidl-utils",
"//zircon/system/ulib/image-format",
"//zircon/system/ulib/region-alloc",
"//zircon/system/ulib/sysmem-make-tracking",
"//zircon/system/ulib/sysmem-version",
]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
driver_module("sysmem") {
configs += [
"//build/config:all_source",
"//build/config/fuchsia:enable_zircon_asserts",
]
configs -= [ "//build/config/fuchsia:no_cpp_standard_library" ]
configs += [ "//build/config/fuchsia:static_cpp_standard_library" ]
if (is_fuchsia) {
fdio_config = [ "//build/config/fuchsia:fdio_config" ]
if (configs + fdio_config - fdio_config != configs) {
configs -= fdio_config
}
}
sources = [ "binding.cc" ]
deps = [
":sysmem_common_srcs",
"//src/devices/lib/driver",
# TODO(fxb/38132): Migrate to the new bind rules and delete the below
"//src/lib/ddk:ddk-deprecated-binding-headers",
]
}
test("sysmem-unittest-executable") {
if (is_fuchsia) {
fdio_config = [ "//build/config/fuchsia:fdio_config" ]
if (configs + fdio_config - fdio_config != configs) {
configs -= fdio_config
}
}
output_name = "sysmem-unittest"
sources = [
"test/contiguous_pooled_memory_allocator_test.cc",
"test/device_test.cc",
"test/pixel_format_cost_test.cc",
]
include_dirs = [ "." ]
deps = [
":sysmem_common_srcs",
"//sdk/banjo/ddk.protocol.platform.bus",
"//sdk/banjo/ddk.protocol.platform.device",
"//sdk/banjo/ddk.protocol.sysmem",
"//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_c",
"//src/devices/testing/fake-bti",
"//src/devices/testing/fake_ddk",
"//src/lib/ddk",
"//src/lib/ddktl",
"//zircon/public/lib/async-cpp",
"//zircon/public/lib/fbl",
"//zircon/public/lib/fidl",
"//zircon/public/lib/fit",
"//zircon/public/lib/sync",
"//zircon/public/lib/zx",
"//zircon/public/lib/zxtest",
"//zircon/system/ulib/async-default",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/closure-queue",
"//zircon/system/ulib/fidl-async-2",
"//zircon/system/ulib/fidl-utils",
"//zircon/system/ulib/image-format",
"//zircon/system/ulib/region-alloc",
"//zircon/system/ulib/sysmem-make-tracking",
"//zircon/system/ulib/sysmem-version",
]
}
unittest_package("sysmem-unittest") {
deps = [ ":sysmem-unittest-executable" ]
tests = [
{
name = "sysmem-unittest"
},
]
}