xref: /aosp_15_r20/system/core/fs_mgr/liblp/Android.bp (revision 00c7fec1bb09f3284aad6a6f96d2f63dfc3650ad)
1//
2// Copyright (C) 2018 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
17package {
18    default_team: "trendy_team_android_kernel",
19    default_applicable_licenses: ["Android-Apache-2.0"],
20}
21
22liblp_lib_deps = [
23    "libbase",
24    "liblog",
25    "libcrypto_utils",
26    "libsparse",
27    "libext4_utils",
28    "libz",
29]
30
31cc_library {
32    name: "liblp",
33    host_supported: true,
34    ramdisk_available: true,
35    vendor_ramdisk_available: true,
36    recovery_available: true,
37    defaults: ["fs_mgr_defaults"],
38    cppflags: [
39        "-D_FILE_OFFSET_BITS=64",
40    ],
41    srcs: [
42        "builder.cpp",
43        "super_layout_builder.cpp",
44        "images.cpp",
45        "partition_opener.cpp",
46        "property_fetcher.cpp",
47        "reader.cpp",
48        "utility.cpp",
49        "writer.cpp",
50    ],
51    shared_libs: [
52        "libcrypto",
53    ] + liblp_lib_deps,
54    target: {
55        windows: {
56            enabled: true,
57        },
58        android: {
59            shared_libs: [
60                "libcutils",
61            ],
62        },
63    },
64    export_include_dirs: ["include"],
65}
66
67cc_defaults {
68    name: "liblp_test_defaults",
69    defaults: ["fs_mgr_defaults"],
70    cppflags: [
71        "-Wno-unused-parameter",
72    ],
73    static_libs: [
74        "libcutils",
75        "libgmock",
76        "liblp",
77        "libcrypto_static",
78    ] + liblp_lib_deps,
79    header_libs: [
80        "libstorage_literals_headers",
81    ],
82    target: {
83        android: {
84            srcs: [
85                "device_test.cpp",
86                "io_test.cpp",
87            ],
88            static_libs: [
89                "libfs_mgr",
90            ],
91        }
92    },
93    stl: "libc++_static",
94    srcs: [
95        "builder_test.cpp",
96        "super_layout_builder_test.cpp",
97        "utility_test.cpp",
98        ":TestPartitionOpener_group",
99    ],
100}
101
102cc_test {
103    name: "liblp_test",
104    defaults: ["liblp_test_defaults"],
105    test_suites: ["device-tests"],
106    auto_gen_config: true,
107    require_root: true,
108    host_supported: true
109}
110
111cc_test {
112    name: "vts_core_liblp_test",
113    defaults: ["liblp_test_defaults"],
114    test_suites: ["vts"],
115    auto_gen_config: true,
116    test_options: {
117        min_shipping_api_level: 29,
118    },
119    require_root: true,
120}
121
122cc_test {
123    name: "vts_kernel_liblp_test",
124    defaults: ["liblp_test_defaults"],
125}
126
127filegroup {
128   name: "TestPartitionOpener_group",
129   srcs: [ "test_partition_opener.cpp"],
130}
131