blob: bd7a5518cb91d249e1ad6c24d34dc004bc29475a [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 "config_read.cpp",
19 "config_write.cpp",
20 "log_event_list.cpp",
21 "log_event_write.cpp",
Tom Cherry408b1442019-01-10 10:37:36 -080022 "logger_lock.cpp",
23 "logger_name.cpp",
24 "logger_read.cpp",
25 "logger_write.cpp",
26 "logprint.cpp",
27 "stderr_write.cpp",
Mark Salyzyn5f9e16a2016-03-01 13:45:42 -080028]
29liblog_host_sources = [
Tom Cherry408b1442019-01-10 10:37:36 -080030 "fake_log_device.cpp",
31 "fake_writer.cpp",
Dan Willemsenae0ef992015-09-16 15:54:14 -070032]
33liblog_target_sources = [
Mark Salyzyn6280b212016-11-21 12:00:03 -080034 "event_tag_map.cpp",
Dan Willemsenae0ef992015-09-16 15:54:14 -070035 "log_time.cpp",
Tom Cherry408b1442019-01-10 10:37:36 -080036 "properties.cpp",
37 "pmsg_reader.cpp",
38 "pmsg_writer.cpp",
39 "logd_reader.cpp",
40 "logd_writer.cpp",
Dan Willemsenae0ef992015-09-16 15:54:14 -070041]
42
Steven Moreland9b999ca2017-07-10 16:40:36 -070043cc_library_headers {
44 name: "liblog_headers",
45 host_supported: true,
46 vendor_available: true,
Jiyong Parkf8c5bd32018-04-27 21:48:43 +090047 recovery_available: true,
Steven Moreland9b999ca2017-07-10 16:40:36 -070048 export_include_dirs: ["include"],
49 target: {
50 windows: {
51 enabled: true,
52 },
53 linux_bionic: {
54 enabled: true,
55 },
56 vendor: {
Steven Morelandafed1442018-01-05 14:42:12 -080057 override_export_include_dirs: ["include_vndk"],
Steven Moreland9b999ca2017-07-10 16:40:36 -070058 },
59 },
60}
61
Dan Willemsenae0ef992015-09-16 15:54:14 -070062// Shared and static library for host and device
63// ========================================================
64cc_library {
65 name: "liblog",
66 host_supported: true,
Jiyong Parkf8c5bd32018-04-27 21:48:43 +090067 recovery_available: true,
Mark Salyzyn5f9e16a2016-03-01 13:45:42 -080068 srcs: liblog_sources,
69
Dan Willemsenae0ef992015-09-16 15:54:14 -070070 target: {
71 host: {
72 srcs: liblog_host_sources,
73 cflags: ["-DFAKE_LOG_DEVICE=1"],
74 },
75 android: {
Tom Cherry366cbbc2019-01-17 11:38:31 -080076 version_script: "liblog.map.txt",
Dan Willemsenae0ef992015-09-16 15:54:14 -070077 srcs: liblog_target_sources,
78 // AddressSanitizer runtime library depends on liblog.
Colin Cross3723b332016-04-07 13:30:22 -070079 sanitize: {
Evgenii Stepanovf1c4ff52016-11-29 15:02:30 -080080 address: false,
Colin Cross3723b332016-04-07 13:30:22 -070081 },
Dan Willemsenae0ef992015-09-16 15:54:14 -070082 },
Ian Pedowitzaf4378d2018-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 Hsiehf55fccb2018-05-23 18:55:10 -070085 pack_relocations: false,
Ian Pedowitzaf4378d2018-01-18 16:25:24 -080086 ldflags: ["-Wl,--hash-style=both"],
87 },
Dan Willemsenae0ef992015-09-16 15:54:14 -070088 windows: {
Dan Willemsenfe3b1432015-11-30 15:35:09 -080089 enabled: true,
Dan Willemsenae0ef992015-09-16 15:54:14 -070090 },
91 not_windows: {
Mark Salyzyn6280b212016-11-21 12:00:03 -080092 srcs: ["event_tag_map.cpp"],
Dan Willemsenae0ef992015-09-16 15:54:14 -070093 },
Dan Willemsen7b8edc62016-11-29 13:39:55 -080094 linux_bionic: {
95 enabled: true,
96 },
Dan Willemsenae0ef992015-09-16 15:54:14 -070097 },
98
Steven Moreland9b999ca2017-07-10 16:40:36 -070099 header_libs: ["liblog_headers"],
100 export_header_lib_headers: ["liblog_headers"],
Vijay Venkatramane15a3b12017-01-25 18:52:17 +0000101
Dan Willemsenae0ef992015-09-16 15:54:14 -0700102 cflags: [
103 "-Werror",
Mark Salyzyn5f9e16a2016-03-01 13:45:42 -0800104 "-fvisibility=hidden",
Dan Willemsenae0ef992015-09-16 15:54:14 -0700105 // This is what we want to do:
106 // liblog_cflags := $(shell \
107 // sed -n \
108 // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \
109 // $(LOCAL_PATH)/event.logtags)
110 // so make sure we do not regret hard-coding it as follows:
Mark Salyzyn77c24e12016-09-12 14:51:48 -0700111 "-DLIBLOG_LOG_TAG=1006",
Mark Salyzyn248bae72016-03-25 15:50:46 -0700112 "-DSNET_EVENT_LOG_TAG=1397638484",
Dan Willemsenae0ef992015-09-16 15:54:14 -0700113 ],
Dan Willemsen53067202016-06-01 15:32:35 -0700114 logtags: ["event.logtags"],
Dan Willemsenae0ef992015-09-16 15:54:14 -0700115 compile_multilib: "both",
Dan Willemsenae0ef992015-09-16 15:54:14 -0700116}
Dan Albertb7f77e22016-09-23 15:43:23 -0700117
Dan Albertf7060b82016-10-05 13:47:31 -0700118ndk_headers {
Steven Moreland9b999ca2017-07-10 16:40:36 -0700119 name: "liblog_ndk_headers",
Mark Salyzynd5a36ed2016-12-21 23:15:24 +0000120 from: "include/android",
Dan Albertf7060b82016-10-05 13:47:31 -0700121 to: "android",
Mark Salyzynd5a36ed2016-12-21 23:15:24 +0000122 srcs: ["include/android/log.h"],
Dan Albert032495f2016-10-20 10:18:27 -0700123 license: "NOTICE",
Dan Albertf7060b82016-10-05 13:47:31 -0700124}
125
Dan Albertb7f77e22016-09-23 15:43:23 -0700126ndk_library {
Dan Willemsenfabc4062017-04-07 15:26:08 -0700127 name: "liblog",
Dan Albertb7f77e22016-09-23 15:43:23 -0700128 symbol_file: "liblog.map.txt",
129 first_version: "9",
Dan Albert522e3f02017-01-05 15:55:49 -0800130 unversioned_until: "current",
Dan Albertb7f77e22016-09-23 15:43:23 -0700131}
Dan Willemsen0856f352017-03-20 14:08:59 -0700132
133llndk_library {
Dan Willemsenfabc4062017-04-07 15:26:08 -0700134 name: "liblog",
Dan Willemsen0856f352017-03-20 14:08:59 -0700135 symbol_file: "liblog.map.txt",
136 unversioned: true,
137 export_include_dirs: ["include_vndk"],
138}