1//
2// Copyright (C) 2020 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//
16
17// TODO(152067309): Stop building this yourself once it's ABI stable and has
18// been made vendor available. Just use libc++fs instead of this.
19
20package {
21    // See: http://go/android-license-faq
22    // A large-scale-change added 'default_applicable_licenses' to import
23    // all of the 'license_kinds' from "hardware_interfaces_license"
24    // to get the below license kinds:
25    //   SPDX-license-identifier-NCSA
26    default_applicable_licenses: ["hardware_interfaces_license"],
27}
28
29cc_defaults {
30    name: "android.hardware.automotive@libc++fsdefaults",
31    local_include_dirs: ["include"],
32    export_include_dirs: ["include"],
33    cflags: [
34        "-Wall",
35        "-Werror",
36        "-Wno-unused-parameter",
37    ],
38    cppflags: [
39        "-std=c++17",
40        "-fexceptions",
41        "-DLIBCXX_BUILDING_LIBCXXABI",
42        "-D_LIBCPP_BUILDING_LIBRARY",
43    ],
44    rtti: true,
45}
46
47cc_library_static {
48    name: "android.hardware.automotive@libc++fs",
49    recovery_available: true,
50    vendor: true,
51    defaults: ["android.hardware.automotive@libc++fsdefaults"],
52    srcs: [
53        "src/filesystem/directory_iterator.cpp",
54        "src/filesystem/operations.cpp",
55    ],
56    multilib: {
57        lib32: {
58            // off_t usage is constrained to within the libc++ source (not the
59            // headers), so we can build the filesystem library with a 64-bit
60            // off_t on LP32 to get large file support without needing all users
61            // of the library to match.
62            cflags: ["-D_FILE_OFFSET_BITS=64"],
63        },
64    },
65    target: {
66        windows: {
67            enabled: false,
68        },
69    },
70}
71