blob: adfee1d1c7023c58ff8a59338ba66a13ae944ff8 [file] [log] [blame]
//
// Copyright (C) 2018 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
cc_defaults {
name: "libsnapshot_defaults",
defaults: ["fs_mgr_defaults"],
cflags: [
"-D_FILE_OFFSET_BITS=64",
"-Wall",
"-Werror",
],
shared_libs: [
"libbase",
"libcutils",
"liblog",
"liblp",
],
static_libs: [
"libdm",
"libfstab",
"update_metadata-protos",
],
whole_static_libs: [
"libext2_uuid",
"libext4_utils",
"libfstab",
],
header_libs: [
"libfiemap_headers",
],
export_static_lib_headers: [
"update_metadata-protos",
],
export_header_lib_headers: [
"libfiemap_headers",
],
export_include_dirs: ["include"],
proto: {
type: "lite",
export_proto_headers: true,
canonical_path_from_root: false,
},
}
cc_defaults {
name: "libsnapshot_hal_deps",
cflags: [
"-DLIBSNAPSHOT_USE_HAL",
],
shared_libs: [
"android.hardware.boot@1.0",
"android.hardware.boot@1.1",
],
}
filegroup {
name: "libsnapshot_sources",
srcs: [
"android/snapshot/snapshot.proto",
"device_info.cpp",
"snapshot.cpp",
"snapshot_metadata_updater.cpp",
"partition_cow_creator.cpp",
"return.cpp",
"utility.cpp",
],
}
cc_library_headers {
name: "libsnapshot_headers",
recovery_available: true,
defaults: ["libsnapshot_defaults"],
}
cc_library_static {
name: "libsnapshot",
defaults: [
"libsnapshot_defaults",
"libsnapshot_hal_deps",
],
srcs: [":libsnapshot_sources"],
static_libs: [
"libfs_mgr_binder"
],
shared_libs: [
// TODO(b/148818798): remove when parent bug is fixed
"libutilscallstack",
],
cflags: [
"-g",
"-O0",
"-DLIBSNAPSHOT_USE_CALLSTACK",
],
}
cc_library_static {
name: "libsnapshot_init",
defaults: ["libsnapshot_defaults"],
srcs: [":libsnapshot_sources"],
recovery_available: true,
static_libs: [
"libfs_mgr",
],
}
cc_library_static {
name: "libsnapshot_nobinder",
defaults: [
"libsnapshot_defaults",
"libsnapshot_hal_deps",
],
srcs: [":libsnapshot_sources"],
recovery_available: true,
static_libs: [
"libfs_mgr",
],
}
cc_library_static {
name: "libsnapshot_test_helpers",
defaults: ["libsnapshot_defaults"],
export_include_dirs: [
"include_test",
],
srcs: [
"android/snapshot/snapshot.proto",
"test_helpers.cpp",
],
shared_libs: [
"android.hardware.boot@1.1",
"libcrypto",
],
export_shared_lib_headers: [
"android.hardware.boot@1.1",
],
header_libs: [
"libstorage_literals_headers",
],
export_header_lib_headers: [
"libstorage_literals_headers",
],
static_libs: [
"libfs_mgr",
"libgmock",
"libgtest",
],
}
cc_defaults {
name: "libsnapshot_test_defaults",
defaults: ["libsnapshot_defaults"],
srcs: [
"partition_cow_creator_test.cpp",
"snapshot_metadata_updater_test.cpp",
"snapshot_test.cpp",
],
shared_libs: [
"android.hardware.boot@1.0",
"android.hardware.boot@1.1",
"libbinder",
"libcrypto",
"libhidlbase",
"libprotobuf-cpp-lite",
"libsparse",
"libutils",
"libz",
// TODO(b/148818798): remove when parent bug is fixed
"libutilscallstack",
],
static_libs: [
"libfs_mgr",
"libgsi",
"libgmock",
"liblp",
"libsnapshot",
"libsnapshot_test_helpers",
],
header_libs: [
"libstorage_literals_headers",
],
test_suites: [
"vts-core",
"device-tests"
],
test_min_api_level: 29,
auto_gen_config: true,
require_root: true,
}
cc_test {
name: "vts_libsnapshot_test",
defaults: ["libsnapshot_test_defaults"],
}
cc_test {
name: "vts_libsnapshot_test_presubmit",
defaults: ["libsnapshot_test_defaults"],
cppflags: [
"-DSKIP_TEST_IN_PRESUBMIT",
],
}
cc_binary {
name: "snapshotctl",
srcs: [
"snapshotctl.cpp",
],
static_libs: [
"libdm",
"libfstab",
"libsnapshot",
],
shared_libs: [
"android.hardware.boot@1.0",
"android.hardware.boot@1.1",
"libbase",
"libbinder",
"libext2_uuid",
"libext4_utils",
"libfs_mgr_binder",
"libhidlbase",
"liblog",
"liblp",
"libprotobuf-cpp-lite",
"libutils",
// TODO(b/148818798): remove when parent bug is fixed.
"libutilscallstack",
],
init_rc: [
"snapshotctl.rc",
],
}