diff --git a/base/Android.bp b/base/Android.bp index 3af768614..afb7dd363 100644 --- a/base/Android.bp +++ b/base/Android.bp @@ -20,8 +20,28 @@ libbase_cppflags = [ "-Werror", ] +cc_library_headers { + name: "libbase_headers", + vendor_available: true, + host_supported: true, + export_include_dirs: ["include"], + + header_libs: ["libutils_headers"], + export_header_lib_headers: ["libutils_headers"], + + target: { + linux_bionic: { + enabled: true, + }, + windows: { + enabled: true, + }, + }, +} + cc_library { name: "libbase", + vendor_available: true, clang: true, host_supported: true, srcs: [ @@ -33,9 +53,11 @@ cc_library { "strings.cpp", "test_utils.cpp", ], - local_include_dirs: ["include"], + + header_libs: ["libbase_headers"], + export_header_lib_headers: ["libbase_headers"], + cppflags: libbase_cppflags, - export_include_dirs: ["include"], shared_libs: ["liblog"], target: { android: { diff --git a/libbacktrace/Android.bp b/libbacktrace/Android.bp index 7de72a876..4a525be97 100644 --- a/libbacktrace/Android.bp +++ b/libbacktrace/Android.bp @@ -62,6 +62,7 @@ cc_library_headers { cc_library { name: "libbacktrace", + vendor_available: true, defaults: ["libbacktrace_common"], host_supported: true, diff --git a/libcutils/Android.bp b/libcutils/Android.bp index 0a3bab744..58170ec71 100644 --- a/libcutils/Android.bp +++ b/libcutils/Android.bp @@ -29,17 +29,15 @@ libcutils_nonwindows_sources = [ "str_parms.c", ] -cc_library_headers { - name: "libcutils_vndk_headers", - host_supported: true, - export_include_dirs: ["include_vndk"], -} - cc_library_headers { name: "libcutils_headers", + vendor_available: true, host_supported: true, export_include_dirs: ["include"], target: { + vendor: { + export_include_dirs: ["include_vndk"], + }, linux_bionic: { enabled: true, }, @@ -51,6 +49,7 @@ cc_library_headers { cc_library { name: "libcutils", + vendor_available: true, host_supported: true, srcs: [ "config_utils.c", diff --git a/libcutils/include_vndk/cutils/log.h b/libcutils/include_vndk/cutils/log.h index ae74024a3..21dc11e43 100644 --- a/libcutils/include_vndk/cutils/log.h +++ b/libcutils/include_vndk/cutils/log.h @@ -16,6 +16,32 @@ */ #ifndef _LIBS_CUTIL_LOG_H #define _LIBS_CUTIL_LOG_H -#warning "Deprecated: don't include cutils/log.h, use either android/log.h or log/log.h" + +/* We do not know if developer wanted log/log.h or subset android/log.h */ #include + +#if defined(__GNUC__) +#if defined( __clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic warning "-W#warnings" +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpedantic" +#elif (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR > 9)) +#pragma GCC diagnostic push +#pragma GCC diagnostic warning "-W#warnings" +#else +#pragma GCC diagnostic push +#pragma GCC diagnostic warning "-Wcpp" +#endif +#endif + +#warning "Deprecated: don't include cutils/log.h, use either android/log.h or log/log.h" + +#if defined(__GNUC__) +#if defined( __clang__) +#pragma clang diagnostic pop +#endif +#pragma GCC diagnostic pop +#endif + #endif /* _LIBS_CUTIL_LOG_H */ diff --git a/libsync/Android.bp b/libsync/Android.bp index a4e55992c..4bafb0854 100644 --- a/libsync/Android.bp +++ b/libsync/Android.bp @@ -8,6 +8,7 @@ cc_defaults { cc_library_shared { name: "libsync", + vendor_available: true, defaults: ["libsync_defaults"], }