blob: bd583cb1ff830a08aed7f54593c47f55abf30501 [file] [log] [blame]
//
// Copyright (C) 2019 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.
//
package {
// See: http://go/android-license-faq
default_applicable_licenses: ["Android-Apache-2.0"],
}
cc_library_shared {
name: "libfuse_jni",
srcs: [
"jni_init.cpp",
"com_android_providers_media_FuseDaemon.cpp",
"FuseDaemon.cpp",
"FuseUtils.cpp",
"MediaProviderWrapper.cpp",
"ReaddirHelper.cpp",
"RedactionInfo.cpp",
"node.cpp",
],
header_libs: [
"bpf_syscall_wrappers",
"libnativehelper_header_only",
],
export_include_dirs: ["include"],
shared_libs: [
"leveldb",
"liblog",
"libfuse",
"libandroid",
],
static_libs: [
"libbase_ndk",
],
cflags: [
"-Wall",
"-Werror",
"-Wno-unused-parameter",
"-Wno-unused-variable",
"-Wthread-safety",
"-D_FILE_OFFSET_BITS=64",
"-DFUSE_USE_VERSION=34",
],
tidy: true,
tidy_checks: [
"-google-runtime-int",
"-performance-no-int-to-ptr",
],
sdk_version: "current",
stl: "c++_static",
min_sdk_version: "30",
apex_available: [
"com.android.mediaprovider",
],
}
cc_library_shared {
name: "libleveldb_jni",
srcs: [
"com_android_providers_media_leveldb_LevelDBInstance.cpp",
],
header_libs: [
"libnativehelper_header_only",
],
apex_available: ["com.android.mediaprovider"],
shared_libs: [
"leveldb",
"liblog",
"libandroid",
],
cflags: [
"-Wall",
"-Werror",
"-Wno-unused-parameter",
"-Wno-unused-variable",
"-Wthread-safety",
],
tidy: true,
tidy_checks: [
"-google-runtime-int",
"-performance-no-int-to-ptr",
],
sdk_version: "current",
stl: "c++_static",
min_sdk_version: "30",
}
filegroup {
name: "fuse_test_default_map",
srcs: ["fuse_test_default.map"],
}
cc_defaults {
name: "fuse_test_defaults",
// These tests run on older platform versions, so many libraries (such as libbase and libc++)
// need to be linked statically. The tests also need to be linked with a version script to
// ensure that the statically-linked library isn't exported from the executable, where it
// would override the shared libraries that the platform itself uses.
// See http://b/333438055 for an example of what goes wrong when libc++ is partially exported
// from an executable.
version_script: ":fuse_test_default_map",
stl: "c++_static",
}
cc_test {
name: "fuse_node_test",
test_suites: [
"device-tests",
"mts-mediaprovider",
],
test_config: "fuse_node_test.xml",
defaults: [
"fuse_test_defaults",
],
compile_multilib: "both",
multilib: {
lib32: {
suffix: "32",
},
lib64: {
suffix: "64",
},
},
srcs: [
"node_test.cpp",
"node.cpp",
"ReaddirHelper.cpp",
"RedactionInfo.cpp",
],
local_include_dirs: ["include"],
static_libs: [
"libbase_ndk",
],
shared_libs: [
"liblog",
],
tidy: true,
tidy_checks: [
"-performance-no-int-to-ptr",
],
sdk_version: "current",
}
cc_test {
name: "RedactionInfoTest",
test_suites: [
"device-tests",
"mts-mediaprovider",
],
test_config: "RedactionInfoTest.xml",
defaults: [
"fuse_test_defaults",
],
compile_multilib: "both",
multilib: {
lib32: {
suffix: "32",
},
lib64: {
suffix: "64",
},
},
srcs: [
"RedactionInfoTest.cpp",
"RedactionInfo.cpp",
],
local_include_dirs: ["include"],
static_libs: [
"libbase_ndk",
],
shared_libs: [
"liblog",
],
tidy: true,
sdk_version: "current",
}
cc_test {
name: "FuseUtilsTest",
test_suites: [
"device-tests",
"mts-mediaprovider",
],
test_config: "FuseUtilsTest.xml",
defaults: [
"fuse_test_defaults",
],
compile_multilib: "both",
multilib: {
lib32: {
suffix: "32",
},
lib64: {
suffix: "64",
},
},
srcs: [
"FuseUtilsTest.cpp",
"FuseUtils.cpp",
],
header_libs: [
"libnativehelper_header_only",
],
local_include_dirs: ["include"],
static_libs: [
"libbase_ndk",
],
shared_libs: [
"liblog",
],
tidy: true,
sdk_version: "current",
}