blob: 9c68fcae1e90276783fe74c94bafea163f979045 [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",
27 //"event.logtags",
Mark Salyzyn93101be2016-03-01 13:45:42 -080028 "fake_writer.c",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070029]
30liblog_target_sources = [
Dan Willemsen63aa47a2015-09-16 15:54:14 -070031 "event_tag_map.c",
Mark Salyzyn93101be2016-03-01 13:45:42 -080032 "config_read.c",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070033 "log_time.cpp",
34 "log_is_loggable.c",
35 "logprint.c",
Mark Salyzyn93101be2016-03-01 13:45:42 -080036 "pmsg_reader.c",
37 "pmsg_writer.c",
38 "logd_reader.c",
39 "logd_writer.c",
40 "logger_read.c",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070041]
42
43// Shared and static library for host and device
44// ========================================================
45cc_library {
46 name: "liblog",
47 host_supported: true,
48
Mark Salyzyn93101be2016-03-01 13:45:42 -080049 srcs: liblog_sources,
50
Dan Willemsen63aa47a2015-09-16 15:54:14 -070051 target: {
52 host: {
53 srcs: liblog_host_sources,
54 cflags: ["-DFAKE_LOG_DEVICE=1"],
55 },
56 android: {
57 srcs: liblog_target_sources,
58 // AddressSanitizer runtime library depends on liblog.
59 sanitize: ["never"],
60 },
61 android_arm: {
Dmitriy Ivanov58558a52015-09-28 10:40:35 -070062 // TODO: This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen63aa47a2015-09-16 15:54:14 -070063 ldflags: ["-Wl,--hash-style=both"],
64 },
65 windows: {
66 srcs: ["uio.c"],
Dan Willemsena3f41bf2015-11-30 15:35:09 -080067 enabled: true,
Dan Willemsen63aa47a2015-09-16 15:54:14 -070068 },
69 not_windows: {
70 srcs: ["event_tag_map.c"],
71 },
72 linux: {
73 host_ldlibs: ["-lrt"],
74 },
75 },
76
77 cflags: [
78 "-Werror",
Mark Salyzyn93101be2016-03-01 13:45:42 -080079 "-fvisibility=hidden",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070080 // This is what we want to do:
81 // liblog_cflags := $(shell \
82 // sed -n \
83 // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \
84 // $(LOCAL_PATH)/event.logtags)
85 // so make sure we do not regret hard-coding it as follows:
86 "-DLIBLOG_LOG_TAG=1005",
Mark Salyzynf58e58a2016-03-25 15:50:46 -070087 "-DSNET_EVENT_LOG_TAG=1397638484",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070088 ],
89 compile_multilib: "both",
90 stl: "none",
91}