platform_system_core/base/Android.bp

159 lines
3.7 KiB
Plaintext
Raw Normal View History

//
// Copyright (C) 2015 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.
//
libbase_cppflags = [
"-Wall",
"-Wextra",
"-Werror",
]
cc_library_headers {
name: "libbase_headers",
vendor_available: true,
host_supported: true,
export_include_dirs: ["include"],
target: {
linux_bionic: {
enabled: true,
},
windows: {
enabled: true,
},
},
}
cc_library {
name: "libbase",
libbase: make vendor_available By setting vendor_available, the following may become true: * a prebuilt library from this release may be used at runtime by in a later releasse (by vendor code compiled against this release). so this library shouldn't depend on runtime state that may change in the future. * this library may be loaded twice into a single process (potentially an old version and a newer version). The symbols will be isolated using linker namespaces, but this may break assumptions about 1 library in 1 process (your singletons will run twice). Background: This means that these modules may be built and installed twice -- once for the system partition and once for the vendor partition. The system version will build just like today, and will be used by the framework components on /system. The vendor version will build against a reduced set of exports and libraries -- similar to, but separate from, the NDK. This means that all your dependencies must also mark vendor_available. At runtime, /system binaries will load libraries from /system/lib*, while /vendor binaries will load libraries from /vendor/lib*. There are some exceptions in both directions -- bionic(libc,etc) and liblog are always loaded from /system. And SP-HALs (OpenGL, etc) may load /vendor code into /system processes, but the dependencies of those libraries will load from /vendor until it reaches a library that's always on /system. In the SP-HAL case, if both framework and vendor libraries depend on a library of the same name, both versions will be loaded, but they will be isolated from each other. It's possible to compile differently -- reducing your source files, exporting different include directories, etc. For details see: https://android-review.googlesource.com/368372 None of this is enabled unless the device opts into the system/vendor split with BOARD_VNDK_VERSION := current. Bug: 33241851 Test: build and flash internal marlin Test: m -j libbase Test: build with BOARD_VNDK_VERSION := current (cherry picked from commit c28517f95611c96628e27eb570ff1c2805cbd5f6) Merged-In: I720a00deada4e62628e6fbc4ac830265de9c669f Change-Id: I720a00deada4e62628e6fbc4ac830265de9c669f
2017-04-14 06:13:57 +08:00
vendor_available: true,
clang: true,
host_supported: true,
srcs: [
"file.cpp",
"logging.cpp",
"parsenetaddress.cpp",
"quick_exit.cpp",
"stringprintf.cpp",
"strings.cpp",
"test_utils.cpp",
],
header_libs: [
"libbase_headers",
],
export_header_lib_headers: ["libbase_headers"],
cppflags: libbase_cppflags,
shared_libs: ["liblog"],
target: {
android: {
srcs: [
"errors_unix.cpp",
"properties.cpp",
"chrono_utils.cpp",
],
cppflags: ["-Wexit-time-destructors"],
sanitize: {
misc_undefined: ["integer"],
},
},
darwin: {
srcs: [
"chrono_utils.cpp",
"errors_unix.cpp",
],
cppflags: ["-Wexit-time-destructors"],
},
linux_bionic: {
srcs: [
"chrono_utils.cpp",
"errors_unix.cpp",
],
cppflags: ["-Wexit-time-destructors"],
enabled: true,
},
linux: {
srcs: [
"chrono_utils.cpp",
"errors_unix.cpp",
],
cppflags: ["-Wexit-time-destructors"],
host_ldlibs: ["-lrt"],
},
windows: {
srcs: [
"errors_windows.cpp",
"utf8.cpp",
],
enabled: true,
},
},
}
// Tests
// ------------------------------------------------------------------------------
cc_test {
name: "libbase_test",
host_supported: true,
clang: true,
srcs: [
"endian_test.cpp",
"errors_test.cpp",
"file_test.cpp",
"logging_test.cpp",
"parsedouble_test.cpp",
"parseint_test.cpp",
"parsenetaddress_test.cpp",
"quick_exit_test.cpp",
"scopeguard_test.cpp",
"stringprintf_test.cpp",
"strings_test.cpp",
"test_main.cpp",
],
target: {
android: {
srcs: [
"chrono_utils_test.cpp",
"properties_test.cpp"
],
sanitize: {
misc_undefined: ["integer"],
},
},
linux: {
srcs: ["chrono_utils_test.cpp"],
host_ldlibs: ["-lrt"],
},
windows: {
srcs: ["utf8_test.cpp"],
enabled: true,
},
},
local_include_dirs: ["."],
cppflags: libbase_cppflags,
shared_libs: ["libbase"],
compile_multilib: "both",
multilib: {
lib32: {
suffix: "32",
},
lib64: {
suffix: "64",
},
},
}