1//
2// Copyright (C) 2017 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16package {
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20cc_library {
21    name: "libcuttlefish_fs",
22    srcs: [
23        "shared_buf.cc",
24        "shared_fd.cpp",
25        "shared_fd_stream.cpp",
26    ],
27    shared_libs: [
28        "libbase",
29        "libcuttlefish_utils_result",
30        "liblog",
31    ],
32    target: {
33        android: {
34            shared_libs: [
35                "libbase",
36                "liblog",
37            ],
38        },
39        darwin: {
40            enabled: true,
41        },
42        host: {
43            shared: {
44                shared_libs: [
45                    "libbase",
46                    "liblog",
47                ],
48            },
49            static: {
50                static_libs: [
51                    "libbase",
52                    "liblog",
53                ],
54            },
55        },
56        linux: {
57            srcs: [
58                "epoll.cpp",
59            ],
60        },
61    },
62    defaults: ["cuttlefish_host"],
63    product_available: true,
64}
65
66cc_test {
67    name: "libcuttlefish_fs_tests",
68    srcs: [
69        "shared_fd_test.cpp",
70    ],
71    shared_libs: [
72        "libbase",
73        "libcuttlefish_fs",
74    ],
75    static_libs: [
76        "libgmock",
77        "libgtest",
78    ],
79    defaults: ["cuttlefish_host"],
80    test_suites: ["general-tests"],
81}
82