blob: e213e90269ed4e0d55849cd7e392648b57510891 [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 "config_read.cpp",
19 "config_write.cpp",
20 "log_event_list.cpp",
21 "log_event_write.cpp",
Mark Salyzyneaece252016-12-14 12:52:50 -080022 "log_ratelimit.cpp",
Tom Cherryf623f022019-01-10 10:37:36 -080023 "logger_lock.cpp",
24 "logger_name.cpp",
25 "logger_read.cpp",
26 "logger_write.cpp",
27 "logprint.cpp",
28 "stderr_write.cpp",
Mark Salyzyn6cdd5312016-03-01 13:45:42 -080029]
30liblog_host_sources = [
Tom Cherryf623f022019-01-10 10:37:36 -080031 "fake_log_device.cpp",
32 "fake_writer.cpp",
Dan Willemsen489ca272015-09-16 15:54:14 -070033]
34liblog_target_sources = [
Mark Salyzyna4097592016-11-21 12:00:03 -080035 "event_tag_map.cpp",
Dan Willemsen489ca272015-09-16 15:54:14 -070036 "log_time.cpp",
Tom Cherryf623f022019-01-10 10:37:36 -080037 "properties.cpp",
38 "pmsg_reader.cpp",
39 "pmsg_writer.cpp",
40 "logd_reader.cpp",
41 "logd_writer.cpp",
Dan Willemsen489ca272015-09-16 15:54:14 -070042]
43
Steven Moreland5a5d2632017-07-10 16:40:36 -070044cc_library_headers {
45 name: "liblog_headers",
46 host_supported: true,
47 vendor_available: true,
Jiyong Parkac945a22018-04-27 21:48:43 +090048 recovery_available: true,
Steven Moreland5a5d2632017-07-10 16:40:36 -070049 export_include_dirs: ["include"],
50 target: {
51 windows: {
52 enabled: true,
53 },
54 linux_bionic: {
55 enabled: true,
56 },
57 vendor: {
Steven Moreland09e90262018-01-05 14:42:12 -080058 override_export_include_dirs: ["include_vndk"],
Steven Moreland5a5d2632017-07-10 16:40:36 -070059 },
60 },
61}
62
Dan Willemsen489ca272015-09-16 15:54:14 -070063// Shared and static library for host and device
64// ========================================================
65cc_library {
66 name: "liblog",
67 host_supported: true,
Jiyong Parkac945a22018-04-27 21:48:43 +090068 recovery_available: true,
Mark Salyzyn6cdd5312016-03-01 13:45:42 -080069 srcs: liblog_sources,
70
Dan Willemsen489ca272015-09-16 15:54:14 -070071 target: {
72 host: {
73 srcs: liblog_host_sources,
74 cflags: ["-DFAKE_LOG_DEVICE=1"],
75 },
76 android: {
77 srcs: liblog_target_sources,
78 // AddressSanitizer runtime library depends on liblog.
Colin Crossd7b701c2016-04-07 13:30:22 -070079 sanitize: {
Evgenii Stepanov37115612016-11-29 15:02:30 -080080 address: false,
Colin Crossd7b701c2016-04-07 13:30:22 -070081 },
Dan Willemsen489ca272015-09-16 15:54:14 -070082 },
Ian Pedowitz91d5a8a2018-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 Hsieh0f8e1372018-05-23 18:55:10 -070085 pack_relocations: false,
Ian Pedowitz91d5a8a2018-01-18 16:25:24 -080086 ldflags: ["-Wl,--hash-style=both"],
87 },
Dan Willemsen489ca272015-09-16 15:54:14 -070088 windows: {
Tom Cherryf623f022019-01-10 10:37:36 -080089 srcs: ["uio.cpp"],
Dan Willemsen34a3d492015-11-30 15:35:09 -080090 enabled: true,
Dan Willemsen489ca272015-09-16 15:54:14 -070091 },
92 not_windows: {
Mark Salyzyna4097592016-11-21 12:00:03 -080093 srcs: ["event_tag_map.cpp"],
Dan Willemsen489ca272015-09-16 15:54:14 -070094 },
Dan Willemsena00f44a2016-11-29 13:39:55 -080095 linux_bionic: {
96 enabled: true,
97 },
Dan Willemsen489ca272015-09-16 15:54:14 -070098 },
99
Steven Moreland5a5d2632017-07-10 16:40:36 -0700100 header_libs: ["liblog_headers"],
101 export_header_lib_headers: ["liblog_headers"],
Vijay Venkatramand2cead52017-01-25 18:52:17 +0000102
Dan Willemsen489ca272015-09-16 15:54:14 -0700103 cflags: [
104 "-Werror",
Mark Salyzyn6cdd5312016-03-01 13:45:42 -0800105 "-fvisibility=hidden",
Dan Willemsen489ca272015-09-16 15:54:14 -0700106 // This is what we want to do:
107 // liblog_cflags := $(shell \
108 // sed -n \
109 // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \
110 // $(LOCAL_PATH)/event.logtags)
111 // so make sure we do not regret hard-coding it as follows:
Mark Salyzyn74e408e2016-09-12 14:51:48 -0700112 "-DLIBLOG_LOG_TAG=1006",
Mark Salyzyn509c1422016-03-25 15:50:46 -0700113 "-DSNET_EVENT_LOG_TAG=1397638484",
Dan Willemsen489ca272015-09-16 15:54:14 -0700114 ],
Dan Willemsen1fdb20d2016-06-01 15:32:35 -0700115 logtags: ["event.logtags"],
Dan Willemsen489ca272015-09-16 15:54:14 -0700116 compile_multilib: "both",
Dan Willemsen489ca272015-09-16 15:54:14 -0700117}
Dan Albert0eb04bf2016-09-23 15:43:23 -0700118
Dan Albert6de176a2016-10-05 13:47:31 -0700119ndk_headers {
Steven Moreland5a5d2632017-07-10 16:40:36 -0700120 name: "liblog_ndk_headers",
Mark Salyzyn0ef234b2016-12-21 23:15:24 +0000121 from: "include/android",
Dan Albert6de176a2016-10-05 13:47:31 -0700122 to: "android",
Mark Salyzyn0ef234b2016-12-21 23:15:24 +0000123 srcs: ["include/android/log.h"],
Dan Albert17587a12016-10-20 10:18:27 -0700124 license: "NOTICE",
Dan Albert6de176a2016-10-05 13:47:31 -0700125}
126
Dan Albert0eb04bf2016-09-23 15:43:23 -0700127ndk_library {
Dan Willemsenb916d0f2017-04-07 15:26:08 -0700128 name: "liblog",
Dan Albert0eb04bf2016-09-23 15:43:23 -0700129 symbol_file: "liblog.map.txt",
130 first_version: "9",
Dan Albert89ebcb72017-01-05 15:55:49 -0800131 unversioned_until: "current",
Dan Albert0eb04bf2016-09-23 15:43:23 -0700132}
Dan Willemsencf6ea4d2017-03-20 14:08:59 -0700133
134llndk_library {
Dan Willemsenb916d0f2017-04-07 15:26:08 -0700135 name: "liblog",
Dan Willemsencf6ea4d2017-03-20 14:08:59 -0700136 symbol_file: "liblog.map.txt",
137 unversioned: true,
138 export_include_dirs: ["include_vndk"],
139}