blob: 2e87b5b285a9fdec68f6f810679349bf10bb6981 [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",
Mark Salyzyn93101be2016-03-01 13:45:42 -080024]
25liblog_host_sources = [
Tom Cherry71ba1642019-01-10 10:37:36 -080026 "fake_log_device.cpp",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070027]
28liblog_target_sources = [
Mark Salyzyned9dc8a2016-11-21 12:00:03 -080029 "event_tag_map.cpp",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070030 "log_time.cpp",
Tom Cherry71ba1642019-01-10 10:37:36 -080031 "properties.cpp",
32 "pmsg_reader.cpp",
33 "pmsg_writer.cpp",
34 "logd_reader.cpp",
35 "logd_writer.cpp",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070036]
37
Steven Moreland95d7cbb2017-07-10 16:40:36 -070038cc_library_headers {
39 name: "liblog_headers",
40 host_supported: true,
41 vendor_available: true,
Yifan Hong7dd45532020-01-21 18:17:19 -080042 ramdisk_available: true,
Jiyong Park612210c2018-04-27 21:48:43 +090043 recovery_available: true,
dimitrya808b112019-05-06 14:01:58 +020044 native_bridge_supported: true,
Steven Moreland95d7cbb2017-07-10 16:40:36 -070045 export_include_dirs: ["include"],
Elliott Hughes3c3bdc12019-02-13 12:42:06 -080046 system_shared_libs: [],
47 stl: "none",
Steven Moreland95d7cbb2017-07-10 16:40:36 -070048 target: {
49 windows: {
50 enabled: true,
51 },
52 linux_bionic: {
53 enabled: true,
54 },
55 vendor: {
Steven Morelande1c834d2018-01-05 14:42:12 -080056 override_export_include_dirs: ["include_vndk"],
Steven Moreland95d7cbb2017-07-10 16:40:36 -070057 },
58 },
59}
60
Dan Willemsen63aa47a2015-09-16 15:54:14 -070061// Shared and static library for host and device
62// ========================================================
63cc_library {
64 name: "liblog",
65 host_supported: true,
Yifan Hong7dd45532020-01-21 18:17:19 -080066 ramdisk_available: true,
Jiyong Park612210c2018-04-27 21:48:43 +090067 recovery_available: true,
dimitrya808b112019-05-06 14:01:58 +020068 native_bridge_supported: true,
Mark Salyzyn93101be2016-03-01 13:45:42 -080069 srcs: liblog_sources,
70
Dan Willemsen63aa47a2015-09-16 15:54:14 -070071 target: {
72 host: {
73 srcs: liblog_host_sources,
74 cflags: ["-DFAKE_LOG_DEVICE=1"],
75 },
76 android: {
Tom Cherry44f00232019-01-17 11:38:31 -080077 version_script: "liblog.map.txt",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070078 srcs: liblog_target_sources,
79 // AddressSanitizer runtime library depends on liblog.
Colin Cross5d35ce62016-04-07 13:30:22 -070080 sanitize: {
Evgenii Stepanovffdabdc2016-11-29 15:02:30 -080081 address: false,
Colin Cross5d35ce62016-04-07 13:30:22 -070082 },
Dan Willemsen63aa47a2015-09-16 15:54:14 -070083 },
Ian Pedowitz7bb97852018-01-18 16:25:24 -080084 android_arm: {
85 // TODO: This is to work around b/24465209. Remove after root cause is fixed
Chih-Hung Hsieh462df102018-05-23 18:55:10 -070086 pack_relocations: false,
Ian Pedowitz7bb97852018-01-18 16:25:24 -080087 ldflags: ["-Wl,--hash-style=both"],
88 },
Dan Willemsen63aa47a2015-09-16 15:54:14 -070089 windows: {
Dan Willemsena3f41bf2015-11-30 15:35:09 -080090 enabled: true,
Dan Willemsen63aa47a2015-09-16 15:54:14 -070091 },
92 not_windows: {
Mark Salyzyned9dc8a2016-11-21 12:00:03 -080093 srcs: ["event_tag_map.cpp"],
Dan Willemsen63aa47a2015-09-16 15:54:14 -070094 },
Dan Willemsen0910d2d2016-11-29 13:39:55 -080095 linux_bionic: {
96 enabled: true,
97 },
Dan Willemsen63aa47a2015-09-16 15:54:14 -070098 },
99
Tom Cherryee747e72019-12-20 16:06:34 -0800100 header_libs: [
101 "libbase_headers",
102 "liblog_headers",
103 ],
Steven Moreland95d7cbb2017-07-10 16:40:36 -0700104 export_header_lib_headers: ["liblog_headers"],
Vijay Venkatraman651f8382017-01-25 18:52:17 +0000105
Tom Cherryfe1f7012019-02-08 11:55:36 -0800106 stubs: {
107 symbol_file: "liblog.map.txt",
Chong Zhang265eee22020-01-15 13:58:13 -0800108 versions: ["29", "30"],
Tom Cherryfe1f7012019-02-08 11:55:36 -0800109 },
110
Tom Cherry896fb9e2019-10-24 10:51:05 -0700111 // TODO(tomcherry): Renable this before release branch is cut
112 header_abi_checker: {
113 enabled: false,
114 },
115
Dan Willemsen63aa47a2015-09-16 15:54:14 -0700116 cflags: [
Tom Cherry7d045f62019-09-30 12:58:55 -0700117 "-Wall",
Dan Willemsen63aa47a2015-09-16 15:54:14 -0700118 "-Werror",
Tom Cherry7d045f62019-09-30 12:58:55 -0700119 "-Wextra",
Dan Willemsen63aa47a2015-09-16 15:54:14 -0700120 // This is what we want to do:
121 // liblog_cflags := $(shell \
122 // sed -n \
123 // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \
124 // $(LOCAL_PATH)/event.logtags)
125 // so make sure we do not regret hard-coding it as follows:
Mark Salyzyn9633b912016-09-12 14:51:48 -0700126 "-DLIBLOG_LOG_TAG=1006",
Mark Salyzyn7ef52492016-03-25 15:50:46 -0700127 "-DSNET_EVENT_LOG_TAG=1397638484",
Dan Willemsen63aa47a2015-09-16 15:54:14 -0700128 ],
Dan Willemsend1191012016-06-01 15:32:35 -0700129 logtags: ["event.logtags"],
Dan Willemsen63aa47a2015-09-16 15:54:14 -0700130 compile_multilib: "both",
Dan Willemsen63aa47a2015-09-16 15:54:14 -0700131}
Dan Albertddce8c72016-09-23 15:43:23 -0700132
Dan Albertb7c39962016-10-05 13:47:31 -0700133ndk_headers {
Steven Moreland95d7cbb2017-07-10 16:40:36 -0700134 name: "liblog_ndk_headers",
Mark Salyzynbdac2212016-12-21 23:15:24 +0000135 from: "include/android",
Dan Albertb7c39962016-10-05 13:47:31 -0700136 to: "android",
Mark Salyzynbdac2212016-12-21 23:15:24 +0000137 srcs: ["include/android/log.h"],
Dan Albert286b2ea2016-10-20 10:18:27 -0700138 license: "NOTICE",
Dan Albertb7c39962016-10-05 13:47:31 -0700139}
140
Dan Albertddce8c72016-09-23 15:43:23 -0700141ndk_library {
Dan Willemsenc8202dc2017-04-07 15:26:08 -0700142 name: "liblog",
Dan Albertddce8c72016-09-23 15:43:23 -0700143 symbol_file: "liblog.map.txt",
144 first_version: "9",
Dan Albert9a41bce2017-01-05 15:55:49 -0800145 unversioned_until: "current",
Dan Albertddce8c72016-09-23 15:43:23 -0700146}
Dan Willemsen38b4a922017-03-20 14:08:59 -0700147
148llndk_library {
Dan Willemsenc8202dc2017-04-07 15:26:08 -0700149 name: "liblog",
dimitrya808b112019-05-06 14:01:58 +0200150 native_bridge_supported: true,
Dan Willemsen38b4a922017-03-20 14:08:59 -0700151 symbol_file: "liblog.map.txt",
Dan Willemsen38b4a922017-03-20 14:08:59 -0700152 export_include_dirs: ["include_vndk"],
153}