| # 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/components.gni") |
| import("//build/cpp/sdk_source_set.gni") |
| import("//build/cpp/sdk_static_library.gni") |
| import("//build/test.gni") |
| |
| # A replacement version of this library is undergoing active development but is not available yet. |
| # Please avoid new dependencies on this library and use //src/storage/lib/vfs/cpp where possible. |
| # This will help ensure a smooth transition when a replacement is complete. |
| # |
| # See https://fxbug.dev/42054034 for details. |
| sdk_source_set("cpp") { |
| category = "partner" |
| |
| sdk_name = "vfs_cpp" |
| |
| include_base = "//sdk" |
| sources = [ |
| "composed_service_dir.cc", |
| "composed_service_dir.h", |
| "flags.h", |
| "internal/connection.cc", |
| "internal/connection.h", |
| "internal/directory.cc", |
| "internal/directory.h", |
| "internal/directory_connection.cc", |
| "internal/directory_connection.h", |
| "internal/dirent_filler.cc", |
| "internal/dirent_filler.h", |
| "internal/file.cc", |
| "internal/file.h", |
| "internal/file_connection.cc", |
| "internal/file_connection.h", |
| "internal/node.cc", |
| "internal/node.h", |
| "internal/node_connection.cc", |
| "internal/node_connection.h", |
| "lazy_dir.cc", |
| "lazy_dir.h", |
| "pseudo_dir.cc", |
| "pseudo_dir.h", |
| "pseudo_file.cc", |
| "pseudo_file.h", |
| "remote_dir.cc", |
| "remote_dir.h", |
| "service.cc", |
| "service.h", |
| "vmo_file.cc", |
| "vmo_file.h", |
| ] |
| |
| public_deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io_hlcpp", |
| "//sdk/lib/fdio", |
| "//sdk/lib/fidl/cpp", |
| "//zircon/system/ulib/async", |
| "//zircon/system/ulib/zx", |
| ] |
| |
| public_configs = [ "//sdk/config" ] |
| |
| # ________ _________ ________ ________ |
| # |\ ____\|\___ ___\\ __ \|\ __ \ |
| # \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \ |
| # \ \_____ \ \ \ \ \ \ \\\ \ \ ____\ |
| # \|____|\ \ \ \ \ \ \ \\\ \ \ \___| |
| # ____\_\ \ \ \__\ \ \_______\ \__\ |
| # |\_________\ \|__| \|_______|\|__| |
| # \|_________| |
| # |
| # Until a replacement for this library is available, please avoid new dependencies on this target |
| # and use //src/storage/lib/vfs/cpp where possible. See https://fxbug.dev/42054034 for details. |
| # |
| # To remove items from the allowlist, please send a change to one of the OWNERS of this file to |
| # remove an element from the visibility list below. Please allowlist entire directories rather |
| # than individual targets as it requires less allowlist churn over time. |
| # |
| # To regenerate: |
| # scripts/gn/trim_visibility.py --target=//sdk/lib/vfs/cpp |
| visibility = [ |
| ":*", |
| "//build/sdk:*", |
| "//sdk/ctf/tests/pkg/svc:*", |
| "//sdk/lib/driver/devicetree/testing:board-test-helper", |
| "//sdk/lib/sys/cpp:*", |
| "//sdk/lib/sys/cpp/testing:*", |
| "//sdk/lib/sys/cpp/tests:*", |
| "//sdk/lib/sys/inspect/cpp:*", |
| "//sdk/lib/sys/service/cpp:*", |
| "//sdk/lib/vfs/cpp/testing:*", |
| "//src/developer/build_info:*", |
| "//src/developer/forensics/feedback_data:*", |
| "//src/devices/bin/driver_host2:*", |
| "//src/devices/bin/driver_manager/v2:*", |
| "//src/devices/sysmem/bin/sysmem_connector:*", |
| "//src/diagnostics/validator/inspect/lib/cpp:*", |
| "//src/graphics/bin/opencl_loader:*", |
| "//src/graphics/bin/opencl_loader/test:*", |
| "//src/graphics/bin/vulkan_loader:*", |
| "//src/graphics/bin/vulkan_loader/test:*", |
| "//src/lib/metrics_buffer:*", |
| "//src/lib/vulkan/gapii-pkg:*", |
| "//src/lib/vulkan/vulkan-validation-pkg:*", |
| "//src/media/audio/audio_core/testing/integration:*", |
| "//src/media/codec/factory:*", |
| "//src/media/lib/codec_impl:*", |
| "//src/modular/bin/sessionmgr:*", |
| "//src/modular/lib/pseudo_dir:*", |
| "//src/storage/conformance/*", |
| "//src/sys/early_boot_instrumentation:*", |
| "//src/sys/early_boot_instrumentation/test:*", |
| "//src/tests/fidl/compatibility/cpp:*", |
| "//src/tests/fidl/compatibility/llcpp:*", |
| "//src/ui/a11y/bin/a11y_manager/tests/util:*", |
| "//src/ui/a11y/lib/configuration/tests:*", |
| "//src/ui/lib/escher:*", |
| "//third_party/tcpdump:*", |
| "//vendor/google/*", |
| ] |
| } |
| |
| test("vfs_cpp_unittests") { |
| sources = [ |
| "composed_service_dir_unittest.cc", |
| "internal/connection_unittest.cc", |
| "internal/file_unittest.cc", |
| "lazy_dir_unittest.cc", |
| "pseudo_dir_unittest.cc", |
| "pseudo_file_unittest.cc", |
| "remote_dir_unittest.cc", |
| "service_unittest.cc", |
| "vmo_file_unittest.cc", |
| ] |
| |
| deps = [ |
| ":cpp", |
| "testing", |
| "//sdk/lib/sys/cpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| "//src/testing/fidl:placeholders_hlcpp", |
| ] |
| } |
| |
| fuchsia_unittest_package("vfs_cpp_tests") { |
| deps = [ ":vfs_cpp_unittests" ] |
| } |
| |
| # *WARNING*: This is an internal static library used to provide a stable ABI to the in-tree C++ VFS |
| # library in `//src/storage/lib/vfs/cpp`. It is only intended for use by the SDK VFS source_set |
| # above, and must not be included as a direct dependency of any other targets. |
| # |
| # All code that requires VFS functionality *must* use the source_set or the in-tree VFS library. |
| sdk_static_library("internal") { |
| # TODO(https://fxbug.dev/293936429): Change to partner when this library is complete, and add to: |
| # - sdk/BUILD.gn |
| # - sdk/manifests/fuchsia_idk.manifest |
| category = "internal" |
| |
| sdk_name = "vfs_cpp_internal" |
| include_base = "//sdk" |
| |
| # Headers are distributed with the source set below. |
| no_headers = true |
| sources = [ |
| "new/internal/libvfs.cc", |
| "new/internal/libvfs_private.h", |
| ] |
| |
| public_deps = [ "//zircon/system/ulib/async" ] |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io_cpp", |
| "//src/storage/lib/vfs/cpp", |
| "//zircon/system/ulib/fbl", |
| ] |
| |
| public_configs = [ "//sdk/config" ] |
| |
| include_base = "//sdk" |
| |
| complete_static_lib = true |
| |
| # ________ _________ ________ ________ |
| # |\ ____\|\___ ___\\ __ \|\ __ \ |
| # \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \ |
| # \ \_____ \ \ \ \ \ \ \\\ \ \ ____\ |
| # \|____|\ \ \ \ \ \ \ \\\ \ \ \___| |
| # ____\_\ \ \ \__\ \ \_______\ \__\ |
| # |\_________\ \|__| \|_______|\|__| |
| # \|_________| |
| # |
| # This is an internal-only library for use by //sdk/lib/vfs:cpp. Targets should depend on the |
| # C++ source_set declared above. |
| visibility = [ |
| ":*", |
| "//build/sdk:*", |
| ] |
| } |
| |
| # **WARNING**: This target is under development and is not intended for non-storage use. |
| # |
| # This is being developed as a drop-in replacement for the existing SDK VFS which uses the in-tree |
| # C++ VFS as a backend to reduce code duplication and ensure consistency between both libraries. |
| sdk_source_set("cpp_new") { |
| # TODO(https://fxbug.dev/293936429): Change to partner when replacing "cpp" with "cpp_new". |
| category = "internal" |
| |
| sdk_name = "vfs_cpp" |
| |
| include_base = "//sdk" |
| |
| sources = [ |
| "new/composed_service_dir.h", |
| "new/internal/libvfs_private.h", |
| "new/internal/node.h", |
| "new/pseudo_dir.h", |
| "new/pseudo_file.h", |
| "new/remote_dir.h", |
| "new/service.h", |
| "new/vmo_file.h", |
| ] |
| |
| sdk_headers_for_internal_use = [ "new/internal/libvfs_private.h" ] |
| |
| public_deps = [ |
| "//sdk/fidl/fuchsia.io:fuchsia.io_hlcpp", |
| "//sdk/lib/fdio", |
| "//sdk/lib/fidl/cpp", |
| "//zircon/system/ulib/async", |
| "//zircon/system/ulib/zx", |
| ] |
| |
| deps = [ ":internal" ] |
| |
| public_configs = [ "//sdk/config" ] |
| |
| # ________ _________ ________ ________ |
| # |\ ____\|\___ ___\\ __ \|\ __ \ |
| # \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \ |
| # \ \_____ \ \ \ \ \ \ \\\ \ \ ____\ |
| # \|____|\ \ \ \ \ \ \ \\\ \ \ \___| |
| # ____\_\ \ \ \__\ \ \_______\ \__\ |
| # |\_________\ \|__| \|_______|\|__| |
| # \|_________| |
| # |
| # This library is under development and should only be used for testing and verification by |
| # storage owned targets. |
| # |
| visibility = [ |
| ":*", |
| "//src/storage/conformance/*", |
| ] |
| } |
| |
| test("vfs_cpp_new_unittests") { |
| sources = [ |
| "new/tests/composed_service_dir_test.cc", |
| "new/tests/pseudo_dir_test.cc", |
| "new/tests/pseudo_file_test.cc", |
| "new/tests/remote_dir_test.cc", |
| "new/tests/service_test.cc", |
| "new/tests/vmo_file_test.cc", |
| ] |
| |
| deps = [ |
| ":cpp_new", |
| "//sdk/lib/fdio", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/testing/loop_fixture", |
| ] |
| } |
| |
| fuchsia_unittest_package("vfs_cpp_new_tests") { |
| deps = [ ":vfs_cpp_new_unittests" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ |
| ":vfs_cpp_new_tests", |
| ":vfs_cpp_tests", |
| ] |
| } |