blob: 58c96b68f4ec982c29560b3c29a8b6ea1ba49d68 [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",
Mark Salyzyn6cdd5312016-03-01 13:45:42 -080024]
25liblog_host_sources = [
Tom Cherryf623f022019-01-10 10:37:36 -080026 "fake_log_device.cpp",
Dan Willemsen489ca272015-09-16 15:54:14 -070027]
28liblog_target_sources = [
Mark Salyzyna4097592016-11-21 12:00:03 -080029 "event_tag_map.cpp",
Dan Willemsen489ca272015-09-16 15:54:14 -070030 "log_time.cpp",
Tom Cherryf623f022019-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 Willemsen489ca272015-09-16 15:54:14 -070036]
37
Steven Moreland5a5d2632017-07-10 16:40:36 -070038cc_library_headers {
39 name: "liblog_headers",
40 host_supported: true,
41 vendor_available: true,
Jiyong Parkac945a22018-04-27 21:48:43 +090042 recovery_available: true,
dimitry7bad46b2019-05-06 14:01:58 +020043 native_bridge_supported: true,
Steven Moreland5a5d2632017-07-10 16:40:36 -070044 export_include_dirs: ["include"],
Elliott Hughes02f0e9c2019-02-13 12:42:06 -080045 system_shared_libs: [],
46 stl: "none",
Steven Moreland5a5d2632017-07-10 16:40:36 -070047 target: {
48 windows: {
49 enabled: true,
50 },
51 linux_bionic: {
52 enabled: true,
53 },
54 vendor: {
Steven Moreland09e90262018-01-05 14:42:12 -080055 override_export_include_dirs: ["include_vndk"],
Steven Moreland5a5d2632017-07-10 16:40:36 -070056 },
57 },
58}
59
Dan Willemsen489ca272015-09-16 15:54:14 -070060// Shared and static library for host and device
61// ========================================================
62cc_library {
63 name: "liblog",
64 host_supported: true,
Jiyong Parkac945a22018-04-27 21:48:43 +090065 recovery_available: true,
dimitry7bad46b2019-05-06 14:01:58 +020066 native_bridge_supported: true,
Mark Salyzyn6cdd5312016-03-01 13:45:42 -080067 srcs: liblog_sources,
68
Dan Willemsen489ca272015-09-16 15:54:14 -070069 target: {
70 host: {
71 srcs: liblog_host_sources,
72 cflags: ["-DFAKE_LOG_DEVICE=1"],
73 },
74 android: {
Tom Cherryd3c83f62019-01-17 11:38:31 -080075 version_script: "liblog.map.txt",
Dan Willemsen489ca272015-09-16 15:54:14 -070076 srcs: liblog_target_sources,
77 // AddressSanitizer runtime library depends on liblog.
Colin Crossd7b701c2016-04-07 13:30:22 -070078 sanitize: {
Evgenii Stepanov37115612016-11-29 15:02:30 -080079 address: false,
Colin Crossd7b701c2016-04-07 13:30:22 -070080 },
Dan Willemsen489ca272015-09-16 15:54:14 -070081 },
Ian Pedowitz91d5a8a2018-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 Hsieh0f8e1372018-05-23 18:55:10 -070084 pack_relocations: false,
Ian Pedowitz91d5a8a2018-01-18 16:25:24 -080085 ldflags: ["-Wl,--hash-style=both"],
86 },
Dan Willemsen489ca272015-09-16 15:54:14 -070087 windows: {
Dan Willemsen34a3d492015-11-30 15:35:09 -080088 enabled: true,
Dan Willemsen489ca272015-09-16 15:54:14 -070089 },
90 not_windows: {
Mark Salyzyna4097592016-11-21 12:00:03 -080091 srcs: ["event_tag_map.cpp"],
Dan Willemsen489ca272015-09-16 15:54:14 -070092 },
Dan Willemsena00f44a2016-11-29 13:39:55 -080093 linux_bionic: {
94 enabled: true,
95 },
Dan Willemsen489ca272015-09-16 15:54:14 -070096 },
97
Tom Cherrye573fd22019-12-20 16:06:34 -080098 header_libs: [
99 "libbase_headers",
100 "liblog_headers",
101 ],
Steven Moreland5a5d2632017-07-10 16:40:36 -0700102 export_header_lib_headers: ["liblog_headers"],
Vijay Venkatramand2cead52017-01-25 18:52:17 +0000103
Tom Cherrycc1701d2019-02-08 11:55:36 -0800104 stubs: {
105 symbol_file: "liblog.map.txt",
Chong Zhang3a821102020-01-15 13:58:13 -0800106 versions: ["29", "30"],
Tom Cherrycc1701d2019-02-08 11:55:36 -0800107 },
108
Tom Cherryaccf48b2019-10-24 10:51:05 -0700109 // TODO(tomcherry): Renable this before release branch is cut
110 header_abi_checker: {
111 enabled: false,
112 },
113
Dan Willemsen489ca272015-09-16 15:54:14 -0700114 cflags: [
Tom Cherry66461152019-09-30 12:58:55 -0700115 "-Wall",
Dan Willemsen489ca272015-09-16 15:54:14 -0700116 "-Werror",
Tom Cherry66461152019-09-30 12:58:55 -0700117 "-Wextra",
Dan Willemsen489ca272015-09-16 15:54:14 -0700118 // This is what we want to do:
119 // liblog_cflags := $(shell \
120 // sed -n \
121 // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \
122 // $(LOCAL_PATH)/event.logtags)
123 // so make sure we do not regret hard-coding it as follows:
Mark Salyzyn74e408e2016-09-12 14:51:48 -0700124 "-DLIBLOG_LOG_TAG=1006",
Mark Salyzyn509c1422016-03-25 15:50:46 -0700125 "-DSNET_EVENT_LOG_TAG=1397638484",
Dan Willemsen489ca272015-09-16 15:54:14 -0700126 ],
Dan Willemsen1fdb20d2016-06-01 15:32:35 -0700127 logtags: ["event.logtags"],
Dan Willemsen489ca272015-09-16 15:54:14 -0700128 compile_multilib: "both",
Dan Willemsen489ca272015-09-16 15:54:14 -0700129}
Dan Albert0eb04bf2016-09-23 15:43:23 -0700130
Dan Albert6de176a2016-10-05 13:47:31 -0700131ndk_headers {
Steven Moreland5a5d2632017-07-10 16:40:36 -0700132 name: "liblog_ndk_headers",
Mark Salyzyn0ef234b2016-12-21 23:15:24 +0000133 from: "include/android",
Dan Albert6de176a2016-10-05 13:47:31 -0700134 to: "android",
Mark Salyzyn0ef234b2016-12-21 23:15:24 +0000135 srcs: ["include/android/log.h"],
Dan Albert17587a12016-10-20 10:18:27 -0700136 license: "NOTICE",
Dan Albert6de176a2016-10-05 13:47:31 -0700137}
138
Dan Albert0eb04bf2016-09-23 15:43:23 -0700139ndk_library {
Dan Willemsenb916d0f2017-04-07 15:26:08 -0700140 name: "liblog",
Dan Albert0eb04bf2016-09-23 15:43:23 -0700141 symbol_file: "liblog.map.txt",
142 first_version: "9",
Dan Albert89ebcb72017-01-05 15:55:49 -0800143 unversioned_until: "current",
Dan Albert0eb04bf2016-09-23 15:43:23 -0700144}
Dan Willemsencf6ea4d2017-03-20 14:08:59 -0700145
146llndk_library {
Dan Willemsenb916d0f2017-04-07 15:26:08 -0700147 name: "liblog",
dimitry7bad46b2019-05-06 14:01:58 +0200148 native_bridge_supported: true,
Dan Willemsencf6ea4d2017-03-20 14:08:59 -0700149 symbol_file: "liblog.map.txt",
Dan Willemsencf6ea4d2017-03-20 14:08:59 -0700150 export_include_dirs: ["include_vndk"],
151}