2016-07-11 23:15:31 +02:00
|
|
|
//
|
|
|
|
// 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",
|
|
|
|
]
|
|
|
|
|
2017-04-14 09:54:46 +02:00
|
|
|
cc_library_headers {
|
|
|
|
name: "libbase_headers",
|
|
|
|
vendor_available: true,
|
|
|
|
host_supported: true,
|
|
|
|
export_include_dirs: ["include"],
|
|
|
|
|
|
|
|
target: {
|
|
|
|
linux_bionic: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
windows: {
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2016-07-11 23:15:31 +02:00
|
|
|
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 00:13:57 +02:00
|
|
|
vendor_available: true,
|
2016-07-11 23:15:31 +02:00
|
|
|
clang: true,
|
|
|
|
host_supported: true,
|
|
|
|
srcs: [
|
|
|
|
"file.cpp",
|
|
|
|
"logging.cpp",
|
|
|
|
"parsenetaddress.cpp",
|
2016-09-13 23:50:57 +02:00
|
|
|
"quick_exit.cpp",
|
2016-07-11 23:15:31 +02:00
|
|
|
"stringprintf.cpp",
|
|
|
|
"strings.cpp",
|
|
|
|
"test_utils.cpp",
|
|
|
|
],
|
2017-04-14 09:54:46 +02:00
|
|
|
|
2017-04-19 02:42:10 +02:00
|
|
|
header_libs: [
|
|
|
|
"libbase_headers",
|
|
|
|
"libutils_headers",
|
|
|
|
],
|
2017-04-14 09:54:46 +02:00
|
|
|
export_header_lib_headers: ["libbase_headers"],
|
|
|
|
|
2016-07-11 23:15:31 +02:00
|
|
|
cppflags: libbase_cppflags,
|
|
|
|
shared_libs: ["liblog"],
|
|
|
|
target: {
|
|
|
|
android: {
|
2016-09-22 01:53:15 +02:00
|
|
|
srcs: [
|
|
|
|
"errors_unix.cpp",
|
|
|
|
"properties.cpp",
|
2017-05-01 23:56:28 +02:00
|
|
|
"chrono_utils.cpp",
|
2016-09-22 01:53:15 +02:00
|
|
|
],
|
2016-07-11 23:15:31 +02:00
|
|
|
cppflags: ["-Wexit-time-destructors"],
|
2017-02-15 00:46:33 +01:00
|
|
|
sanitize: {
|
|
|
|
misc_undefined: ["integer"],
|
|
|
|
},
|
2017-03-24 19:43:02 +01:00
|
|
|
|
2016-07-11 23:15:31 +02:00
|
|
|
},
|
|
|
|
darwin: {
|
2017-03-24 19:43:02 +01:00
|
|
|
srcs: [
|
2017-05-01 23:56:28 +02:00
|
|
|
"chrono_utils.cpp",
|
2017-03-24 19:43:02 +01:00
|
|
|
"errors_unix.cpp",
|
|
|
|
],
|
2016-07-11 23:15:31 +02:00
|
|
|
cppflags: ["-Wexit-time-destructors"],
|
|
|
|
},
|
2016-11-29 22:32:55 +01:00
|
|
|
linux_bionic: {
|
2017-03-24 19:43:02 +01:00
|
|
|
srcs: [
|
2017-05-01 23:56:28 +02:00
|
|
|
"chrono_utils.cpp",
|
2017-03-24 19:43:02 +01:00
|
|
|
"errors_unix.cpp",
|
|
|
|
],
|
2016-11-29 22:32:55 +01:00
|
|
|
cppflags: ["-Wexit-time-destructors"],
|
|
|
|
enabled: true,
|
|
|
|
},
|
2016-07-11 23:15:31 +02:00
|
|
|
linux: {
|
2017-03-24 19:43:02 +01:00
|
|
|
srcs: [
|
2017-05-01 23:56:28 +02:00
|
|
|
"chrono_utils.cpp",
|
2017-03-24 19:43:02 +01:00
|
|
|
"errors_unix.cpp",
|
|
|
|
],
|
2016-07-11 23:15:31 +02:00
|
|
|
cppflags: ["-Wexit-time-destructors"],
|
2017-03-24 19:43:02 +01:00
|
|
|
host_ldlibs: ["-lrt"],
|
2016-07-11 23:15:31 +02:00
|
|
|
},
|
|
|
|
windows: {
|
|
|
|
srcs: [
|
|
|
|
"errors_windows.cpp",
|
|
|
|
"utf8.cpp",
|
|
|
|
],
|
|
|
|
enabled: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
// Tests
|
|
|
|
// ------------------------------------------------------------------------------
|
|
|
|
cc_test {
|
|
|
|
name: "libbase_test",
|
|
|
|
host_supported: true,
|
|
|
|
clang: true,
|
|
|
|
srcs: [
|
2017-02-24 23:02:05 +01:00
|
|
|
"endian_test.cpp",
|
2016-07-11 23:15:31 +02:00
|
|
|
"errors_test.cpp",
|
|
|
|
"file_test.cpp",
|
|
|
|
"logging_test.cpp",
|
2016-10-05 19:54:35 +02:00
|
|
|
"parsedouble_test.cpp",
|
2016-07-11 23:15:31 +02:00
|
|
|
"parseint_test.cpp",
|
|
|
|
"parsenetaddress_test.cpp",
|
2016-09-13 23:50:57 +02:00
|
|
|
"quick_exit_test.cpp",
|
2017-04-05 23:15:31 +02:00
|
|
|
"scopeguard_test.cpp",
|
2016-07-11 23:15:31 +02:00
|
|
|
"stringprintf_test.cpp",
|
|
|
|
"strings_test.cpp",
|
|
|
|
"test_main.cpp",
|
|
|
|
],
|
|
|
|
target: {
|
2016-09-22 01:53:15 +02:00
|
|
|
android: {
|
2017-03-24 19:43:02 +01:00
|
|
|
srcs: [
|
|
|
|
"chrono_utils_test.cpp",
|
|
|
|
"properties_test.cpp"
|
|
|
|
],
|
2017-02-15 00:46:33 +01:00
|
|
|
sanitize: {
|
|
|
|
misc_undefined: ["integer"],
|
|
|
|
},
|
2016-09-22 01:53:15 +02:00
|
|
|
},
|
2017-03-24 19:43:02 +01:00
|
|
|
linux: {
|
|
|
|
srcs: ["chrono_utils_test.cpp"],
|
|
|
|
host_ldlibs: ["-lrt"],
|
|
|
|
},
|
2016-07-11 23:15:31 +02:00
|
|
|
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",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|