blob: 7a95dbde66fa629b29240a0d15cd0988a40d0d38 [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
Dan Willemsen7d5457e2016-02-29 10:46:18 -080017liblog_sources = [
Dan Willemsen7d5457e2016-02-29 10:46:18 -080018 "log_event_list.c",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070019 "log_event_write.c",
Mark Salyzyn018a96d2016-03-01 13:45:42 -080020 "logger_write.c",
21 "config_write.c",
22 "logger_name.c",
23 "logger_lock.c",
Dan Willemsen7d5457e2016-02-29 10:46:18 -080024]
25liblog_host_sources = [
Dan Willemsen63aa47a2015-09-16 15:54:14 -070026 "fake_log_device.c",
27 //"event.logtags",
Mark Salyzyn018a96d2016-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 Salyzyn018a96d2016-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 Salyzyn018a96d2016-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
Dan Willemsen7d5457e2016-02-29 10:46:18 -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.
Colin Cross5d35ce62016-04-07 13:30:22 -070059 sanitize: {
60 never: true,
61 },
Dan Willemsen63aa47a2015-09-16 15:54:14 -070062 },
63 android_arm: {
Dmitriy Ivanov58558a52015-09-28 10:40:35 -070064 // TODO: This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen63aa47a2015-09-16 15:54:14 -070065 ldflags: ["-Wl,--hash-style=both"],
66 },
67 windows: {
68 srcs: ["uio.c"],
Dan Willemsena3f41bf2015-11-30 15:35:09 -080069 enabled: true,
Dan Willemsen63aa47a2015-09-16 15:54:14 -070070 },
71 not_windows: {
72 srcs: ["event_tag_map.c"],
73 },
74 linux: {
75 host_ldlibs: ["-lrt"],
76 },
77 },
78
79 cflags: [
80 "-Werror",
81 // 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 ],
90 compile_multilib: "both",
91 stl: "none",
92}