blob: e32f73cdc7d9cf9e74574bafcceb46f50eae7acb [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 = [
18 "log_event_list.c",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070019 "log_event_write.c",
Mark Salyzyn93101be2016-03-01 13:45:42 -080020 "logger_write.c",
21 "config_write.c",
22 "logger_name.c",
23 "logger_lock.c",
24]
25liblog_host_sources = [
Dan Willemsen63aa47a2015-09-16 15:54:14 -070026 "fake_log_device.c",
Mark Salyzyn93101be2016-03-01 13:45:42 -080027 "fake_writer.c",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070028]
29liblog_target_sources = [
Dan Willemsen63aa47a2015-09-16 15:54:14 -070030 "event_tag_map.c",
Mark Salyzyn93101be2016-03-01 13:45:42 -080031 "config_read.c",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070032 "log_time.cpp",
33 "log_is_loggable.c",
34 "logprint.c",
Mark Salyzyn93101be2016-03-01 13:45:42 -080035 "pmsg_reader.c",
36 "pmsg_writer.c",
37 "logd_reader.c",
38 "logd_writer.c",
39 "logger_read.c",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070040]
41
42// Shared and static library for host and device
43// ========================================================
44cc_library {
45 name: "liblog",
46 host_supported: true,
47
Mark Salyzyn93101be2016-03-01 13:45:42 -080048 srcs: liblog_sources,
49
Dan Willemsen63aa47a2015-09-16 15:54:14 -070050 target: {
51 host: {
52 srcs: liblog_host_sources,
53 cflags: ["-DFAKE_LOG_DEVICE=1"],
54 },
55 android: {
56 srcs: liblog_target_sources,
57 // AddressSanitizer runtime library depends on liblog.
Colin Cross5d35ce62016-04-07 13:30:22 -070058 sanitize: {
59 never: true,
60 },
Dan Willemsen63aa47a2015-09-16 15:54:14 -070061 },
62 android_arm: {
Dmitriy Ivanov58558a52015-09-28 10:40:35 -070063 // TODO: This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen63aa47a2015-09-16 15:54:14 -070064 ldflags: ["-Wl,--hash-style=both"],
65 },
66 windows: {
67 srcs: ["uio.c"],
Dan Willemsena3f41bf2015-11-30 15:35:09 -080068 enabled: true,
Dan Willemsen63aa47a2015-09-16 15:54:14 -070069 },
70 not_windows: {
71 srcs: ["event_tag_map.c"],
72 },
73 linux: {
74 host_ldlibs: ["-lrt"],
75 },
76 },
77
78 cflags: [
79 "-Werror",
Mark Salyzyn93101be2016-03-01 13:45:42 -080080 "-fvisibility=hidden",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070081 // This is what we want to do:
82 // liblog_cflags := $(shell \
83 // sed -n \
84 // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \
85 // $(LOCAL_PATH)/event.logtags)
86 // so make sure we do not regret hard-coding it as follows:
87 "-DLIBLOG_LOG_TAG=1005",
Mark Salyzyn7ef52492016-03-25 15:50:46 -070088 "-DSNET_EVENT_LOG_TAG=1397638484",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070089 ],
Dan Willemsend1191012016-06-01 15:32:35 -070090 logtags: ["event.logtags"],
Dan Willemsen63aa47a2015-09-16 15:54:14 -070091 compile_multilib: "both",
92 stl: "none",
93}