blob: b5c41348b892430a525978c3975118f87e572c38 [file] [log] [blame]
Dan Willemsen489ca272015-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 Salyzyn6cdd5312016-03-01 13:45:42 -080017liblog_sources = [
Tom Cherryf623f022019-01-10 10:37:36 -080018 "log_event_list.cpp",
19 "log_event_write.cpp",
Tom Cherryf623f022019-01-10 10:37:36 -080020 "logger_name.cpp",
21 "logger_read.cpp",
22 "logger_write.cpp",
23 "logprint.cpp",
Tom Cherryc377c7d2020-01-27 15:45:52 -080024 "properties.cpp",
Dan Willemsen489ca272015-09-16 15:54:14 -070025]
26liblog_target_sources = [
Mark Salyzyna4097592016-11-21 12:00:03 -080027 "event_tag_map.cpp",
Dan Willemsen489ca272015-09-16 15:54:14 -070028 "log_time.cpp",
Tom Cherryf623f022019-01-10 10:37:36 -080029 "pmsg_reader.cpp",
30 "pmsg_writer.cpp",
31 "logd_reader.cpp",
32 "logd_writer.cpp",
Dan Willemsen489ca272015-09-16 15:54:14 -070033]
34
Steven Moreland5a5d2632017-07-10 16:40:36 -070035cc_library_headers {
36 name: "liblog_headers",
37 host_supported: true,
38 vendor_available: true,
Yifan Hong336e1792020-01-21 18:17:19 -080039 ramdisk_available: true,
Yifan Hong0cc91e52020-10-21 18:51:44 -070040 vendor_ramdisk_available: true,
Jiyong Parkac945a22018-04-27 21:48:43 +090041 recovery_available: true,
Jiyong Park416a40b2020-03-07 16:36:09 +090042 apex_available: [
43 "//apex_available:platform",
44 "//apex_available:anyapex",
45 ],
Jooyung Hanf17abbf2020-04-16 18:48:33 +090046 min_sdk_version: "29",
Tom Cherry003b74d2020-09-17 14:30:25 -070047 sdk_version: "minimum",
dimitry7bad46b2019-05-06 14:01:58 +020048 native_bridge_supported: true,
Steven Moreland5a5d2632017-07-10 16:40:36 -070049 export_include_dirs: ["include"],
Elliott Hughes02f0e9c2019-02-13 12:42:06 -080050 system_shared_libs: [],
51 stl: "none",
Steven Moreland5a5d2632017-07-10 16:40:36 -070052 target: {
53 windows: {
54 enabled: true,
55 },
56 linux_bionic: {
57 enabled: true,
58 },
59 vendor: {
Steven Moreland09e90262018-01-05 14:42:12 -080060 override_export_include_dirs: ["include_vndk"],
Steven Moreland5a5d2632017-07-10 16:40:36 -070061 },
62 },
63}
64
Dan Willemsen489ca272015-09-16 15:54:14 -070065// Shared and static library for host and device
66// ========================================================
67cc_library {
68 name: "liblog",
69 host_supported: true,
Yifan Hong336e1792020-01-21 18:17:19 -080070 ramdisk_available: true,
Yifan Hong38869942020-10-23 17:42:37 -070071 vendor_ramdisk_available: true,
Jiyong Parkac945a22018-04-27 21:48:43 +090072 recovery_available: true,
dimitry7bad46b2019-05-06 14:01:58 +020073 native_bridge_supported: true,
Mark Salyzyn6cdd5312016-03-01 13:45:42 -080074 srcs: liblog_sources,
75
Dan Willemsen489ca272015-09-16 15:54:14 -070076 target: {
Dan Willemsen489ca272015-09-16 15:54:14 -070077 android: {
Tom Cherryd3c83f62019-01-17 11:38:31 -080078 version_script: "liblog.map.txt",
Dan Willemsen489ca272015-09-16 15:54:14 -070079 srcs: liblog_target_sources,
80 // AddressSanitizer runtime library depends on liblog.
Colin Crossd7b701c2016-04-07 13:30:22 -070081 sanitize: {
Evgenii Stepanov37115612016-11-29 15:02:30 -080082 address: false,
Colin Crossd7b701c2016-04-07 13:30:22 -070083 },
Dan Willemsen489ca272015-09-16 15:54:14 -070084 },
Ian Pedowitz91d5a8a2018-01-18 16:25:24 -080085 android_arm: {
86 // TODO: This is to work around b/24465209. Remove after root cause is fixed
Chih-Hung Hsieh0f8e1372018-05-23 18:55:10 -070087 pack_relocations: false,
Ian Pedowitz91d5a8a2018-01-18 16:25:24 -080088 ldflags: ["-Wl,--hash-style=both"],
89 },
Dan Willemsen489ca272015-09-16 15:54:14 -070090 windows: {
Dan Willemsen34a3d492015-11-30 15:35:09 -080091 enabled: true,
Dan Willemsen489ca272015-09-16 15:54:14 -070092 },
93 not_windows: {
Mark Salyzyna4097592016-11-21 12:00:03 -080094 srcs: ["event_tag_map.cpp"],
Dan Willemsen489ca272015-09-16 15:54:14 -070095 },
Dan Willemsena00f44a2016-11-29 13:39:55 -080096 linux_bionic: {
97 enabled: true,
98 },
Dan Willemsen489ca272015-09-16 15:54:14 -070099 },
100
Tom Cherrye573fd22019-12-20 16:06:34 -0800101 header_libs: [
102 "libbase_headers",
Tom Cherryc52ed0b2020-09-17 09:38:42 -0700103 "libcutils_headers",
Tom Cherrye573fd22019-12-20 16:06:34 -0800104 "liblog_headers",
105 ],
Steven Moreland5a5d2632017-07-10 16:40:36 -0700106 export_header_lib_headers: ["liblog_headers"],
Vijay Venkatramand2cead52017-01-25 18:52:17 +0000107
Tom Cherrycc1701d2019-02-08 11:55:36 -0800108 stubs: {
109 symbol_file: "liblog.map.txt",
Chong Zhang3a821102020-01-15 13:58:13 -0800110 versions: ["29", "30"],
Tom Cherrycc1701d2019-02-08 11:55:36 -0800111 },
112
Dan Willemsen489ca272015-09-16 15:54:14 -0700113 cflags: [
Tom Cherry66461152019-09-30 12:58:55 -0700114 "-Wall",
Dan Willemsen489ca272015-09-16 15:54:14 -0700115 "-Werror",
Tom Cherry66461152019-09-30 12:58:55 -0700116 "-Wextra",
Dan Willemsen489ca272015-09-16 15:54:14 -0700117 // This is what we want to do:
118 // liblog_cflags := $(shell \
119 // sed -n \
120 // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \
121 // $(LOCAL_PATH)/event.logtags)
122 // so make sure we do not regret hard-coding it as follows:
Mark Salyzyn74e408e2016-09-12 14:51:48 -0700123 "-DLIBLOG_LOG_TAG=1006",
Mark Salyzyn509c1422016-03-25 15:50:46 -0700124 "-DSNET_EVENT_LOG_TAG=1397638484",
Dan Willemsen489ca272015-09-16 15:54:14 -0700125 ],
Dan Willemsen1fdb20d2016-06-01 15:32:35 -0700126 logtags: ["event.logtags"],
Dan Willemsen489ca272015-09-16 15:54:14 -0700127 compile_multilib: "both",
Jeffrey Huangc0cbd462020-02-13 12:31:07 -0800128 apex_available: [
Jeffrey Huangc0cbd462020-02-13 12:31:07 -0800129 "//apex_available:platform",
Jiyong Parkc17e4492020-03-09 14:35:57 +0900130 // liblog is exceptionally available to the runtime APEX
131 // because the dynamic linker has to use it statically.
132 // See b/151051671
133 "com.android.runtime",
134 // DO NOT add more apex names here
Jeffrey Huangc0cbd462020-02-13 12:31:07 -0800135 ],
Dan Willemsen489ca272015-09-16 15:54:14 -0700136}
Dan Albert0eb04bf2016-09-23 15:43:23 -0700137
Dan Albert6de176a2016-10-05 13:47:31 -0700138ndk_headers {
Steven Moreland5a5d2632017-07-10 16:40:36 -0700139 name: "liblog_ndk_headers",
Mark Salyzyn0ef234b2016-12-21 23:15:24 +0000140 from: "include/android",
Dan Albert6de176a2016-10-05 13:47:31 -0700141 to: "android",
Mark Salyzyn0ef234b2016-12-21 23:15:24 +0000142 srcs: ["include/android/log.h"],
Dan Albert17587a12016-10-20 10:18:27 -0700143 license: "NOTICE",
Dan Albert6de176a2016-10-05 13:47:31 -0700144}
145
Dan Albert0eb04bf2016-09-23 15:43:23 -0700146ndk_library {
Dan Willemsenb916d0f2017-04-07 15:26:08 -0700147 name: "liblog",
Dan Albert0eb04bf2016-09-23 15:43:23 -0700148 symbol_file: "liblog.map.txt",
149 first_version: "9",
Dan Albert89ebcb72017-01-05 15:55:49 -0800150 unversioned_until: "current",
Dan Albert0eb04bf2016-09-23 15:43:23 -0700151}
Dan Willemsencf6ea4d2017-03-20 14:08:59 -0700152
153llndk_library {
Dan Willemsenb916d0f2017-04-07 15:26:08 -0700154 name: "liblog",
dimitry7bad46b2019-05-06 14:01:58 +0200155 native_bridge_supported: true,
Dan Willemsencf6ea4d2017-03-20 14:08:59 -0700156 symbol_file: "liblog.map.txt",
Dan Willemsencf6ea4d2017-03-20 14:08:59 -0700157 export_include_dirs: ["include_vndk"],
158}