platform_system_core/libsync/Android.bp
Jesse Hall 081806e5f2 sync: Add NDK sync.h and libsync
The new header provides an updated interface to libsync appropriate
for the NDK. Clients use existing syscalls where possible (e.g. poll()
instead of sync_wait()), and the remaining functions return structures
used in mainline Linux kernels rather than the Android staging sync
framework.

Over time, framework clients will be migrated to using the NDK
interface, which will eventually replace the current internal
interface. The only difference is the header will be named
<android/sync.h> in the NDK and <sync/sync.h> internally.

Bug: 35138793
Test: sync-unit-tests on bullhead
Change-Id: Ieb3649b80565393e26b604416158438d32c2a256
2017-02-23 18:44:50 -08:00

55 lines
1.1 KiB
Text

ndk_headers {
name: "libsync_headers",
from: "include/ndk",
to: "android",
srcs: ["include/ndk/sync.h"],
license: "NOTICE",
}
ndk_library {
name: "libsync.ndk",
symbol_file: "libsync.map.txt",
first_version: "26",
}
cc_defaults {
name: "libsync_defaults",
srcs: ["sync.c"],
local_include_dirs: ["include"],
export_include_dirs: ["include"],
cflags: ["-Werror"],
}
cc_library_shared {
name: "libsync",
defaults: ["libsync_defaults"],
}
// libsync_recovery is only intended for the recovery binary.
// Future versions of the kernel WILL require an updated libsync, and will break
// anything statically linked against the current libsync.
cc_library_static {
name: "libsync_recovery",
defaults: ["libsync_defaults"],
}
cc_test {
name: "sync_test",
defaults: ["libsync_defaults"],
gtest: false,
srcs: ["sync_test.c"],
}
cc_test {
name: "sync-unit-tests",
shared_libs: ["libsync"],
srcs: ["tests/sync_test.cpp"],
cflags: [
"-g",
"-Wall",
"-Werror",
"-Wno-missing-field-initializers",
"-Wno-sign-compare",
],
clang: true,
}