blob: 59ab250b988220364720c6074c69866b6c815008 [file] [log] [blame]
Dan Willemsen63aa47a2015-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 Salyzyn93101be2016-03-01 13:45:42 -080017liblog_sources = [
Tom Cherry71ba1642019-01-10 10:37:36 -080018 "log_event_list.cpp",
19 "log_event_write.cpp",
Tom Cherry71ba1642019-01-10 10:37:36 -080020 "logger_name.cpp",
21 "logger_read.cpp",
22 "logger_write.cpp",
23 "logprint.cpp",
Tom Cherrye2187bf2020-01-27 15:45:52 -080024 "properties.cpp",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070025]
26liblog_target_sources = [
Mark Salyzyned9dc8a2016-11-21 12:00:03 -080027 "event_tag_map.cpp",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070028 "log_time.cpp",
Tom Cherry71ba1642019-01-10 10:37:36 -080029 "pmsg_reader.cpp",
30 "pmsg_writer.cpp",
31 "logd_reader.cpp",
32 "logd_writer.cpp",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070033]
34
Steven Moreland95d7cbb2017-07-10 16:40:36 -070035cc_library_headers {
36 name: "liblog_headers",
37 host_supported: true,
38 vendor_available: true,
Yifan Hong7dd45532020-01-21 18:17:19 -080039 ramdisk_available: true,
Jiyong Park612210c2018-04-27 21:48:43 +090040 recovery_available: true,
Jiyong Park8bf9b162020-03-07 16:36:09 +090041 apex_available: [
42 "//apex_available:platform",
43 "//apex_available:anyapex",
44 ],
Jooyung Han3851f7e2020-04-16 18:48:33 +090045 min_sdk_version: "29",
Tom Cherryb80d98d2020-09-17 14:30:25 -070046 sdk_version: "minimum",
dimitrya808b112019-05-06 14:01:58 +020047 native_bridge_supported: true,
Steven Moreland95d7cbb2017-07-10 16:40:36 -070048 export_include_dirs: ["include"],
Elliott Hughes3c3bdc12019-02-13 12:42:06 -080049 system_shared_libs: [],
50 stl: "none",
Steven Moreland95d7cbb2017-07-10 16:40:36 -070051 target: {
52 windows: {
53 enabled: true,
54 },
55 linux_bionic: {
56 enabled: true,
57 },
58 vendor: {
Steven Morelande1c834d2018-01-05 14:42:12 -080059 override_export_include_dirs: ["include_vndk"],
Steven Moreland95d7cbb2017-07-10 16:40:36 -070060 },
61 },
62}
63
Dan Willemsen63aa47a2015-09-16 15:54:14 -070064// Shared and static library for host and device
65// ========================================================
66cc_library {
67 name: "liblog",
68 host_supported: true,
Yifan Hong7dd45532020-01-21 18:17:19 -080069 ramdisk_available: true,
Jiyong Park612210c2018-04-27 21:48:43 +090070 recovery_available: true,
dimitrya808b112019-05-06 14:01:58 +020071 native_bridge_supported: true,
Mark Salyzyn93101be2016-03-01 13:45:42 -080072 srcs: liblog_sources,
73
Dan Willemsen63aa47a2015-09-16 15:54:14 -070074 target: {
Dan Willemsen63aa47a2015-09-16 15:54:14 -070075 android: {
Tom Cherry44f00232019-01-17 11:38:31 -080076 version_script: "liblog.map.txt",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070077 srcs: liblog_target_sources,
78 // AddressSanitizer runtime library depends on liblog.
Colin Cross5d35ce62016-04-07 13:30:22 -070079 sanitize: {
Evgenii Stepanovffdabdc2016-11-29 15:02:30 -080080 address: false,
Colin Cross5d35ce62016-04-07 13:30:22 -070081 },
Dan Willemsen63aa47a2015-09-16 15:54:14 -070082 },
Ian Pedowitz7bb97852018-01-18 16:25:24 -080083 android_arm: {
84 // TODO: This is to work around b/24465209. Remove after root cause is fixed
Chih-Hung Hsieh462df102018-05-23 18:55:10 -070085 pack_relocations: false,
Ian Pedowitz7bb97852018-01-18 16:25:24 -080086 ldflags: ["-Wl,--hash-style=both"],
87 },
Dan Willemsen63aa47a2015-09-16 15:54:14 -070088 windows: {
Dan Willemsena3f41bf2015-11-30 15:35:09 -080089 enabled: true,
Dan Willemsen63aa47a2015-09-16 15:54:14 -070090 },
91 not_windows: {
Mark Salyzyned9dc8a2016-11-21 12:00:03 -080092 srcs: ["event_tag_map.cpp"],
Dan Willemsen63aa47a2015-09-16 15:54:14 -070093 },
Dan Willemsen0910d2d2016-11-29 13:39:55 -080094 linux_bionic: {
95 enabled: true,
96 },
Dan Willemsen63aa47a2015-09-16 15:54:14 -070097 },
98
Tom Cherryee747e72019-12-20 16:06:34 -080099 header_libs: [
100 "libbase_headers",
101 "liblog_headers",
102 ],
Steven Moreland95d7cbb2017-07-10 16:40:36 -0700103 export_header_lib_headers: ["liblog_headers"],
Vijay Venkatraman651f8382017-01-25 18:52:17 +0000104
Tom Cherryfe1f7012019-02-08 11:55:36 -0800105 stubs: {
106 symbol_file: "liblog.map.txt",
Chong Zhang265eee22020-01-15 13:58:13 -0800107 versions: ["29", "30"],
Tom Cherryfe1f7012019-02-08 11:55:36 -0800108 },
109
Dan Willemsen63aa47a2015-09-16 15:54:14 -0700110 cflags: [
Tom Cherry7d045f62019-09-30 12:58:55 -0700111 "-Wall",
Dan Willemsen63aa47a2015-09-16 15:54:14 -0700112 "-Werror",
Tom Cherry7d045f62019-09-30 12:58:55 -0700113 "-Wextra",
Dan Willemsen63aa47a2015-09-16 15:54:14 -0700114 // This is what we want to do:
115 // liblog_cflags := $(shell \
116 // sed -n \
117 // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \
118 // $(LOCAL_PATH)/event.logtags)
119 // so make sure we do not regret hard-coding it as follows:
Mark Salyzyn9633b912016-09-12 14:51:48 -0700120 "-DLIBLOG_LOG_TAG=1006",
Mark Salyzyn7ef52492016-03-25 15:50:46 -0700121 "-DSNET_EVENT_LOG_TAG=1397638484",
Dan Willemsen63aa47a2015-09-16 15:54:14 -0700122 ],
Dan Willemsend1191012016-06-01 15:32:35 -0700123 logtags: ["event.logtags"],
Dan Willemsen63aa47a2015-09-16 15:54:14 -0700124 compile_multilib: "both",
Jeffrey Huang66f58a32020-02-13 12:31:07 -0800125 apex_available: [
Jeffrey Huang66f58a32020-02-13 12:31:07 -0800126 "//apex_available:platform",
Jiyong Park95b6f452020-03-09 14:35:57 +0900127 // liblog is exceptionally available to the runtime APEX
128 // because the dynamic linker has to use it statically.
129 // See b/151051671
130 "com.android.runtime",
131 // DO NOT add more apex names here
Jeffrey Huang66f58a32020-02-13 12:31:07 -0800132 ],
Dan Willemsen63aa47a2015-09-16 15:54:14 -0700133}
Dan Albertddce8c72016-09-23 15:43:23 -0700134
Dan Albertb7c39962016-10-05 13:47:31 -0700135ndk_headers {
Steven Moreland95d7cbb2017-07-10 16:40:36 -0700136 name: "liblog_ndk_headers",
Mark Salyzynbdac2212016-12-21 23:15:24 +0000137 from: "include/android",
Dan Albertb7c39962016-10-05 13:47:31 -0700138 to: "android",
Mark Salyzynbdac2212016-12-21 23:15:24 +0000139 srcs: ["include/android/log.h"],
Dan Albert286b2ea2016-10-20 10:18:27 -0700140 license: "NOTICE",
Dan Albertb7c39962016-10-05 13:47:31 -0700141}
142
Dan Albertddce8c72016-09-23 15:43:23 -0700143ndk_library {
Dan Willemsenc8202dc2017-04-07 15:26:08 -0700144 name: "liblog",
Dan Albertddce8c72016-09-23 15:43:23 -0700145 symbol_file: "liblog.map.txt",
146 first_version: "9",
Dan Albert9a41bce2017-01-05 15:55:49 -0800147 unversioned_until: "current",
Dan Albertddce8c72016-09-23 15:43:23 -0700148}
Dan Willemsen38b4a922017-03-20 14:08:59 -0700149
150llndk_library {
Dan Willemsenc8202dc2017-04-07 15:26:08 -0700151 name: "liblog",
dimitrya808b112019-05-06 14:01:58 +0200152 native_bridge_supported: true,
Dan Willemsen38b4a922017-03-20 14:08:59 -0700153 symbol_file: "liblog.map.txt",
Dan Willemsen38b4a922017-03-20 14:08:59 -0700154 export_include_dirs: ["include_vndk"],
155}