| # Copyright 2020 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") |
| |
| group("tools") { |
| deps = [ ":sysmem-memory-pressure" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":sysmem-memory-pressure-test" ] |
| } |
| |
| source_set("common_srcs") { |
| sources = [ "memory-pressure.cc" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.sysmem:fuchsia.sysmem_llcpp", |
| "//sdk/lib/fdio", |
| "//src/lib/fsl", |
| "//src/lib/fxl", |
| ] |
| |
| # TODO(fxbug.dev/69585): This target uses raw zx::channel with LLCPP which is deprecated. |
| # Please migrate to typed channel APIs (fidl::ClientEnd<T>, fidl::ServerEnd<T>). |
| # See linked bug for details. |
| configs += [ "//build/cpp:fidl-llcpp-deprecated-raw-channels" ] |
| } |
| |
| executable("memory-pressure-executable") { |
| output_name = "sysmem-memory-pressure" |
| sources = [ "main.cc" ] |
| deps = [ ":common_srcs" ] |
| } |
| |
| executable("memory-pressure-test-executable") { |
| testonly = true |
| output_name = "sysmem-memory-pressure-test" |
| sources = [ "test.cc" ] |
| |
| deps = [ |
| ":common_srcs", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gtest", |
| "//zircon/system/ulib/fbl", |
| ] |
| } |
| |
| fuchsia_component("memory-pressure") { |
| component_name = "sysmem-memory-pressure" |
| manifest = "meta/sysmem-memory-pressure.cmx" |
| deps = [ ":memory-pressure-executable" ] |
| } |
| |
| fuchsia_package("sysmem-memory-pressure") { |
| deps = [ ":memory-pressure" ] |
| } |
| |
| fuchsia_component("memory-pressure-test-component") { |
| testonly = true |
| component_name = "sysmem-memory-pressure-test" |
| manifest = "meta/sysmem-memory-pressure-test.cmx" |
| deps = [ ":memory-pressure-test-executable" ] |
| } |
| |
| fuchsia_test_package("sysmem-memory-pressure-test") { |
| test_components = [ ":memory-pressure-test-component" ] |
| } |