| # Copyright 2023 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.gni") |
| import("//build/test.gni") |
| |
| library_sources = [ |
| "backlight-fidl-adapter.cc", |
| "backlight-fidl-adapter.h", |
| "backlight-interface.h", |
| "display-engine-events-fidl.cc", |
| "display-engine-events-fidl.h", |
| "display-engine-events-interface.h", |
| "display-engine-fidl-adapter.cc", |
| "display-engine-fidl-adapter.h", |
| "display-engine-interface.cc", |
| "display-engine-interface.h", |
| "inplace-vector.cc", |
| "inplace-vector.h", |
| ] |
| |
| library_deps = [ |
| "//sdk/fidl/fuchsia.images2:fuchsia.images2_cpp", |
| "//sdk/fidl/fuchsia.math:fuchsia.math_cpp", |
| "//sdk/lib/driver/logging/cpp", |
| ] |
| |
| library_public_deps = [ |
| "//sdk/fidl/fuchsia.hardware.backlight:fuchsia.hardware.backlight_cpp", |
| "//sdk/fidl/fuchsia.hardware.display.engine:fuchsia.hardware.display.engine_cpp", |
| "//sdk/fidl/fuchsia.hardware.display.types:fuchsia.hardware.display.types_cpp", |
| "//sdk/fidl/fuchsia.sysmem2:fuchsia.sysmem2_cpp", |
| "//sdk/lib/driver/compat/cpp", |
| "//sdk/lib/stdcompat", |
| "//src/graphics/display/lib/api-types/cpp", |
| "//zircon/system/ulib/zx", |
| ] |
| |
| source_set("cpp") { |
| sources = library_sources |
| deps = library_deps |
| public_deps = library_public_deps |
| } |
| |
| # TODO(https://fxbug.dev/378965477): Remove once C++17 support is dropped. |
| source_set("cpp-cxx17") { |
| sources = library_sources |
| deps = library_deps |
| public_deps = library_public_deps |
| |
| # Remove the C++ language specifier. |
| configs -= [ "//build/config:language" ] |
| configs += [ ":cxx17" ] |
| } |
| |
| test_sources = [ |
| "backlight-fidl-adapter-test.cc", |
| "backlight-interface-test.cc", |
| "display-engine-events-fidl-test.cc", |
| "display-engine-events-interface-test.cc", |
| "display-engine-fidl-adapter-test.cc", |
| "display-engine-interface-test.cc", |
| "inplace-vector-test.cc", |
| "mock-backlight.cc", |
| "mock-backlight.h", |
| "mock-display-engine.cc", |
| "mock-display-engine.h", |
| "mock-fidl-display-engine-listener.cc", |
| "mock-fidl-display-engine-listener.h", |
| ] |
| |
| group("test-deps") { |
| testonly = true |
| visibility = [ ":*" ] |
| public_deps = [ |
| "//sdk/lib/async:async-cpp", |
| "//sdk/lib/async-loop:async-loop-cpp", |
| "//sdk/lib/async-loop:async-loop-default", |
| "//sdk/lib/driver/testing/cpp", |
| "//sdk/lib/driver/testing/cpp:scoped_global_logger", |
| "//sdk/lib/fit", |
| "//src/devices/bin/driver_runtime", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/predicates", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| "//zircon/system/ulib/image-format", |
| "//zircon/system/ulib/sync:sync-cpp", |
| ] |
| } |
| |
| test("unittests") { |
| sources = test_sources |
| output_name = "display-api-protocols-cpp-tests" |
| deps = [ |
| ":cpp", |
| ":test-deps", |
| ] |
| visibility = [ ":*" ] |
| } |
| |
| # TODO(https://fxbug.dev/378965477): Remove once C++17 support is dropped. |
| test("unittests-cxx17") { |
| sources = test_sources |
| output_name = "display-api-protocols-cpp17-tests" |
| deps = [ |
| ":cpp-cxx17", |
| ":test-deps", |
| ] |
| visibility = [ ":*" ] |
| |
| # Remove the C++ language specifier. |
| configs -= [ "//build/config:language" ] |
| configs += [ ":cxx17" ] |
| } |
| |
| # TODO(https://fxbug.dev/378965477): Remove once C++17 support is dropped. |
| config("cxx17") { |
| visibility = [ ":*" ] |
| cflags_cc = [ "-std=c++17" ] |
| } |
| |
| fuchsia_unittest_package("unittests-package") { |
| package_name = "display-api-protocols-cpp-tests" |
| deps = [ ":unittests" ] |
| } |
| |
| # TODO(https://fxbug.dev/378965477): Remove once C++17 support is dropped. |
| fuchsia_unittest_package("unittests-cxx17-package") { |
| package_name = "display-api-protocols-cpp17-tests" |
| deps = [ ":unittests-cxx17" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":unittests-cxx17-package", |
| ":unittests-package", |
| ] |
| } |