blob: 6051ac7fa6a6757d06ea242f682f064431231a27 [file] [log] [blame]
Dan Willemsenae0ef992015-09-16 15:54:14 -07001//
2// Copyright (C) 2008-2014 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
Mark Salyzyn5f9e16a2016-03-01 13:45:42 -080017liblog_sources = [
Tom Cherry408b1442019-01-10 10:37:36 -080018 "log_event_list.cpp",
19 "log_event_write.cpp",
Tom Cherry408b1442019-01-10 10:37:36 -080020 "logger_name.cpp",
21 "logger_read.cpp",
22 "logger_write.cpp",
23 "logprint.cpp",
Tom Cherry1a3d90c2020-01-27 15:45:52 -080024 "properties.cpp",
Dan Willemsenae0ef992015-09-16 15:54:14 -070025]
26liblog_target_sources = [
Mark Salyzyn6280b212016-11-21 12:00:03 -080027 "event_tag_map.cpp",
Dan Willemsenae0ef992015-09-16 15:54:14 -070028 "log_time.cpp",
Tom Cherry408b1442019-01-10 10:37:36 -080029 "pmsg_reader.cpp",
30 "pmsg_writer.cpp",
31 "logd_reader.cpp",
32 "logd_writer.cpp",
Dan Willemsenae0ef992015-09-16 15:54:14 -070033]
34
Steven Moreland9b999ca2017-07-10 16:40:36 -070035cc_library_headers {
36 name: "liblog_headers",
37 host_supported: true,
38 vendor_available: true,
Yifan Hong2ab0b8e2020-01-21 18:17:19 -080039 ramdisk_available: true,
Jiyong Parkf8c5bd32018-04-27 21:48:43 +090040 recovery_available: true,
Jiyong Park71f618c2020-03-07 16:36:09 +090041 apex_available: [
42 "//apex_available:platform",
43 "//apex_available:anyapex",
44 ],
Jooyung Han8adaf8e2020-04-16 18:48:33 +090045 min_sdk_version: "29",
dimitry23b61922019-05-06 14:01:58 +020046 native_bridge_supported: true,
Steven Moreland9b999ca2017-07-10 16:40:36 -070047 export_include_dirs: ["include"],
Elliott Hughese02adef2019-02-13 12:42:06 -080048 system_shared_libs: [],
49 stl: "none",
Steven Moreland9b999ca2017-07-10 16:40:36 -070050 target: {
51 windows: {
52 enabled: true,
53 },
54 linux_bionic: {
55 enabled: true,
56 },
57 vendor: {
Steven Morelandafed1442018-01-05 14:42:12 -080058 override_export_include_dirs: ["include_vndk"],
Steven Moreland9b999ca2017-07-10 16:40:36 -070059 },
60 },
61}
62
Dan Willemsenae0ef992015-09-16 15:54:14 -070063// Shared and static library for host and device
64// ========================================================
65cc_library {
66 name: "liblog",
67 host_supported: true,
Yifan Hong2ab0b8e2020-01-21 18:17:19 -080068 ramdisk_available: true,
Jiyong Parkf8c5bd32018-04-27 21:48:43 +090069 recovery_available: true,
dimitry23b61922019-05-06 14:01:58 +020070 native_bridge_supported: true,
Mark Salyzyn5f9e16a2016-03-01 13:45:42 -080071 srcs: liblog_sources,
72
Dan Willemsenae0ef992015-09-16 15:54:14 -070073 target: {
Dan Willemsenae0ef992015-09-16 15:54:14 -070074 android: {
Tom Cherry366cbbc2019-01-17 11:38:31 -080075 version_script: "liblog.map.txt",
Dan Willemsenae0ef992015-09-16 15:54:14 -070076 srcs: liblog_target_sources,
77 // AddressSanitizer runtime library depends on liblog.
Colin Cross3723b332016-04-07 13:30:22 -070078 sanitize: {
Evgenii Stepanovf1c4ff52016-11-29 15:02:30 -080079 address: false,
Colin Cross3723b332016-04-07 13:30:22 -070080 },
Dan Willemsenae0ef992015-09-16 15:54:14 -070081 },
Ian Pedowitzaf4378d2018-01-18 16:25:24 -080082 android_arm: {
83 // TODO: This is to work around b/24465209. Remove after root cause is fixed
Chih-Hung Hsiehf55fccb2018-05-23 18:55:10 -070084 pack_relocations: false,
Ian Pedowitzaf4378d2018-01-18 16:25:24 -080085 ldflags: ["-Wl,--hash-style=both"],
86 },
Dan Willemsenae0ef992015-09-16 15:54:14 -070087 windows: {
Dan Willemsenfe3b1432015-11-30 15:35:09 -080088 enabled: true,
Dan Willemsenae0ef992015-09-16 15:54:14 -070089 },
90 not_windows: {
Mark Salyzyn6280b212016-11-21 12:00:03 -080091 srcs: ["event_tag_map.cpp"],
Dan Willemsenae0ef992015-09-16 15:54:14 -070092 },
Dan Willemsen7b8edc62016-11-29 13:39:55 -080093 linux_bionic: {
94 enabled: true,
95 },
Dan Willemsenae0ef992015-09-16 15:54:14 -070096 },
97
Tom Cherryca030432019-12-20 16:06:34 -080098 header_libs: [
99 "libbase_headers",
100 "liblog_headers",
101 ],
Steven Moreland9b999ca2017-07-10 16:40:36 -0700102 export_header_lib_headers: ["liblog_headers"],
Vijay Venkatramane15a3b12017-01-25 18:52:17 +0000103
Tom Cherryaadd4a72019-02-08 11:55:36 -0800104 stubs: {
105 symbol_file: "liblog.map.txt",
Chong Zhang9f77e9d2020-01-15 13:58:13 -0800106 versions: ["29", "30"],
Tom Cherryaadd4a72019-02-08 11:55:36 -0800107 },
108
Dan Willemsenae0ef992015-09-16 15:54:14 -0700109 cflags: [
Tom Cherryb78cd022019-09-30 12:58:55 -0700110 "-Wall",
Dan Willemsenae0ef992015-09-16 15:54:14 -0700111 "-Werror",
Tom Cherryb78cd022019-09-30 12:58:55 -0700112 "-Wextra",
Dan Willemsenae0ef992015-09-16 15:54:14 -0700113 // This is what we want to do:
114 // liblog_cflags := $(shell \
115 // sed -n \
116 // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \
117 // $(LOCAL_PATH)/event.logtags)
118 // so make sure we do not regret hard-coding it as follows:
Mark Salyzyn77c24e12016-09-12 14:51:48 -0700119 "-DLIBLOG_LOG_TAG=1006",
Mark Salyzyn248bae72016-03-25 15:50:46 -0700120 "-DSNET_EVENT_LOG_TAG=1397638484",
Dan Willemsenae0ef992015-09-16 15:54:14 -0700121 ],
Dan Willemsen53067202016-06-01 15:32:35 -0700122 logtags: ["event.logtags"],
Dan Willemsenae0ef992015-09-16 15:54:14 -0700123 compile_multilib: "both",
Jeffrey Huang7ff19582020-02-13 12:31:07 -0800124 apex_available: [
Jeffrey Huang7ff19582020-02-13 12:31:07 -0800125 "//apex_available:platform",
Jiyong Park0db97252020-03-09 14:35:57 +0900126 // liblog is exceptionally available to the runtime APEX
127 // because the dynamic linker has to use it statically.
128 // See b/151051671
129 "com.android.runtime",
130 // DO NOT add more apex names here
Jeffrey Huang7ff19582020-02-13 12:31:07 -0800131 ],
Dan Willemsenae0ef992015-09-16 15:54:14 -0700132}
Dan Albertb7f77e22016-09-23 15:43:23 -0700133
Dan Albertf7060b82016-10-05 13:47:31 -0700134ndk_headers {
Steven Moreland9b999ca2017-07-10 16:40:36 -0700135 name: "liblog_ndk_headers",
Mark Salyzynd5a36ed2016-12-21 23:15:24 +0000136 from: "include/android",
Dan Albertf7060b82016-10-05 13:47:31 -0700137 to: "android",
Mark Salyzynd5a36ed2016-12-21 23:15:24 +0000138 srcs: ["include/android/log.h"],
Dan Albert032495f2016-10-20 10:18:27 -0700139 license: "NOTICE",
Dan Albertf7060b82016-10-05 13:47:31 -0700140}
141
Dan Albertb7f77e22016-09-23 15:43:23 -0700142ndk_library {
Dan Willemsenfabc4062017-04-07 15:26:08 -0700143 name: "liblog",
Dan Albertb7f77e22016-09-23 15:43:23 -0700144 symbol_file: "liblog.map.txt",
145 first_version: "9",
Dan Albert522e3f02017-01-05 15:55:49 -0800146 unversioned_until: "current",
Dan Albertb7f77e22016-09-23 15:43:23 -0700147}
Dan Willemsen0856f352017-03-20 14:08:59 -0700148
149llndk_library {
Dan Willemsenfabc4062017-04-07 15:26:08 -0700150 name: "liblog",
dimitry23b61922019-05-06 14:01:58 +0200151 native_bridge_supported: true,
Dan Willemsen0856f352017-03-20 14:08:59 -0700152 symbol_file: "liblog.map.txt",
Dan Willemsen0856f352017-03-20 14:08:59 -0700153 export_include_dirs: ["include_vndk"],
154}