| # Copyright 2016 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/bind/bind.gni") |
| import("//build/config/fuchsia/rules.gni") |
| import("//build/drivers/fuchsia_driver_component.gni") |
| import("//src/graphics/lib/magma/gnbuild/magma.gni") |
| |
| # The gpu device |
| driver_module("msd_intel-driver") { |
| output_name = "libmsd_intel" |
| |
| deps = [ |
| ":msd_intel_entry", |
| "$magma_build_root/src/magma_util/platform:logger_for_system_drivers", |
| "src", |
| ] |
| } |
| |
| fuchsia_driver_component("msd_intel") { |
| component_name = "libmsd_intel" |
| deps = [ ":msd_intel-driver" ] |
| } |
| |
| # The gpu device; runs gtests at startup |
| driver_module("msd_intel_test-driver") { |
| testonly = true |
| |
| output_name = "libmsd_intel_test" |
| |
| deps = [ |
| ":msd_intel_test_entry", |
| "$magma_build_root/src/magma_util/platform:logger_for_system_drivers", |
| "src", |
| ] |
| } |
| |
| fuchsia_driver_component("msd_intel_test") { |
| testonly = true |
| component_name = "libmsd_intel_test" |
| deps = [ ":msd_intel_test-driver" ] |
| } |
| |
| driver_bind_rules("msd_intel_bind") { |
| rules = "msd_intel.bind" |
| header_output = "bind.h" |
| tests = "tests/bind_tests.json" |
| deps = [ "//src/devices/bind/fuchsia.intel.gpucore" ] |
| } |
| |
| driver_bind_rules("msd_intel_test_bind") { |
| rules = "msd_intel.bind" |
| header_output = "test_bind.h" |
| disable_autobind = true |
| deps = [ "//src/devices/bind/fuchsia.intel.gpucore" ] |
| } |
| |
| source_set("msd_intel_entry") { |
| public_configs = [ "$msd_intel_gen_build_root:msd_src_include_config" ] |
| sources = [ "src/driver_entry.cc" ] |
| |
| # Add the target gen directory as an include path so that `#include "bind.h"` will find the |
| # correct generated bind header. This allows us to use the same binding.cc file with multiple |
| # different bind rules. |
| include_dirs = [ "${target_gen_dir}" ] |
| |
| deps = [ |
| ":msd_intel_bind", |
| "src", |
| "//sdk/fidl/fuchsia.gpu.magma:fuchsia.gpu.magma_llcpp", |
| "//src/devices/lib/driver", |
| "//src/graphics/lib/magma/src/magma_util:macros", |
| "//src/graphics/lib/magma/src/magma_util/platform:trace", |
| "//src/graphics/lib/magma/src/magma_util/platform:trace_provider", |
| "//src/graphics/lib/magma/src/magma_util/platform:trace_provider_with_fdio", |
| "//src/graphics/lib/magma/src/magma_util/platform/zircon:performance_counter_device", |
| "//src/graphics/lib/magma/src/sys_driver", |
| "//src/lib/ddk", |
| "//src/zircon/lib/zircon", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| source_set("msd_intel_test_entry") { |
| testonly = true |
| |
| public_configs = [ "$msd_intel_gen_build_root:msd_src_include_config" ] |
| sources = [ "src/driver_entry.cc" ] |
| defines = [ "MAGMA_TEST_DRIVER=1" ] |
| |
| # Add the target gen directory as an include path so that `#include "bind.h"` will find the |
| # correct generated bind header. |
| include_dirs = [ "${target_gen_dir}" ] |
| |
| deps = [ |
| ":msd_intel_test_bind", |
| "src", |
| "//sdk/fidl/fuchsia.gpu.magma:fuchsia.gpu.magma_llcpp", |
| "//src/devices/lib/driver", |
| "//src/graphics/lib/magma/src/magma_util:macros", |
| "//src/graphics/lib/magma/src/magma_util/platform:trace", |
| "//src/graphics/lib/magma/src/magma_util/platform:trace_provider", |
| "//src/graphics/lib/magma/src/magma_util/platform:trace_provider_with_fdio", |
| "//src/graphics/lib/magma/src/sys_driver", |
| "//src/lib/ddk", |
| "//src/zircon/lib/zircon", |
| "//zircon/public/lib/zx", |
| ] |
| deps += [ |
| "tests/unit_tests:hardware_tests", |
| "//src/graphics/lib/magma/src/magma_util/platform/zircon:pci_driver_gtest", |
| "//src/graphics/lib/magma/src/magma_util/platform/zircon:performance_counter_device", |
| "//src/graphics/lib/magma/tests/unit_tests:magma_platform_hardware_tests", |
| "//src/graphics/lib/magma/tests/unit_tests:msd_abi_conformance_tests", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ |
| ":msd_intel_bind_test", |
| "tests/unit_tests:msd_intel_gen_nonhardware_tests", |
| ] |
| } |
| |
| # This config allows inclusion of headers via relative paths |
| config("msd_tests_include_config") { |
| include_dirs = [ "tests" ] |
| } |
| |
| # This config allows inclusion of headers via relative paths |
| config("msd_src_include_config") { |
| include_dirs = [ "src" ] |
| } |