• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2020 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_applicable_licenses: ["system_incremental_delivery_incfs_license"],
17}
18
19// Added automatically by a large-scale-change that took the approach of
20// 'apply every license found to every target'. While this makes sure we respect
21// every license restriction, it may not be entirely correct.
22//
23// e.g. GPL in an MIT project might only apply to the contrib/ directory.
24//
25// Please consider splitting the single license below into multiple licenses,
26// taking care not to lose any license_kind information, and overriding the
27// default license using the 'licenses: [...]' property on targets as needed.
28//
29// For unused files, consider creating a 'fileGroup' with "//visibility:private"
30// to attach the license to, and including a comment whether the files may be
31// used in the current project.
32// See: http://go/android-license-faq
33license {
34    name: "system_incremental_delivery_incfs_license",
35    visibility: [":__subpackages__"],
36    license_kinds: [
37        "SPDX-license-identifier-Apache-2.0",
38    ],
39    license_text: [
40        "NOTICE",
41    ],
42}
43
44cc_defaults {
45    name: "libincfs_defaults_common",
46    cpp_std: "c++2a",
47    cflags: ["-Werror", "-Wall", "-Wextra", "-Wno-deprecated-enum-enum-conversion", "-D_FILE_OFFSET_BITS=64"],
48    tidy: true,
49    tidy_checks: [
50        "android-*",
51        "cert-*",
52        "clang-analyzer-security*",
53        "-cert-err34-c",
54        "clang-analyzer-security*",
55        // Disabling due to many unavoidable warnings from POSIX API usage.
56        "-google-runtime-int",
57        "-google-explicit-constructor",
58        // operator=() does not handle self-assignment properly - all protobuf-generated classes
59        "-cert-oop54-cpp",
60    ],
61    target: {
62        linux_bionic: {
63            enabled: true,
64        },
65    },
66}
67
68cc_defaults {
69    name: "libincfs_defaults",
70    defaults: [
71        "libincfs_defaults_common",
72        "linux_bionic_supported",
73    ],
74    header_libs: ["libincfs_headers"],
75    export_header_lib_headers: ["libincfs_headers"],
76    static_libs: [
77        "libbase",
78    ],
79    shared_libs: [
80        "libcrypto",
81        "liblog",
82        "libselinux",
83    ],
84    target: {
85        android: {
86            static_libs: [
87                "com.android.sysprop.incremental",
88            ],
89        },
90    },
91}
92
93cc_library {
94    name: "libincfs",
95    defaults: ["libincfs_defaults"],
96    srcs: [
97        "incfs_ndk.c",
98        "incfs.cpp",
99        "MountRegistry.cpp",
100        "path.cpp",
101    ],
102}
103
104cc_library_static {
105    name: "libincfs-utils",
106    defaults: ["libincfs_defaults_common"],
107    local_include_dirs: ["util/include"],
108    export_include_dirs: ["util/include"],
109    host_supported: true,
110    srcs: [
111        "util/map_ptr.cpp",
112    ],
113    target: {
114        android: {
115            header_libs: ["libincfs_headers"],
116            shared_libs: [
117                "libbase",
118                "libincfs",
119                "libutils",
120            ],
121        },
122        host: {
123            static_libs: [
124                "libbase",
125                "libutils",
126            ],
127        },
128        windows: {
129            enabled: true,
130        },
131    },
132}
133
134cc_library_headers {
135    name: "libincfs_headers",
136    export_include_dirs: ["include/", "kernel-headers",],
137    host_supported: true,
138    target: {
139        linux_bionic: {
140            enabled: true,
141        }
142    }
143}
144
145cc_test {
146    name: "libincfs-test",
147    defaults: ["libincfs_defaults"],
148    local_include_dirs: ["tests/include"],
149    static_libs: [
150        "libincfs",
151        "libincfs-utils",
152    ],
153    shared_libs: [
154        "libbase",
155        "libutils",
156    ],
157    srcs: [
158        "tests/util/map_ptr_test.cpp",
159        "tests/incfs_test.cpp",
160        "tests/MountRegistry_test.cpp",
161    ],
162    require_root: true,
163    test_suites: [
164        "general-tests",
165        "device-tests",
166    ],
167}
168
169cc_benchmark {
170    name: "hardening-benchmark",
171    defaults: ["libincfs_defaults"],
172
173    srcs: [
174        "tests/hardening_benchmark.cpp",
175    ],
176    static_libs: [
177        "libziparchive_for_incfs",
178        "libutils",
179        "libincfs",
180        "libincfs-utils",
181    ],
182}
183
184cc_binary {
185    name: "incfsdump",
186    defaults: ["libincfs_defaults"],
187    host_supported: true,
188    static_libs: [
189        "libbase",
190    ],
191    srcs: [
192        "incfsdump/main.cpp",
193        "incfsdump/dump.cpp",
194    ],
195    target: {
196        linux_glibc: {
197            enabled: true,
198        },
199    },
200}
201