blob: ee883f0373f9f5646ff2704ba6a2aea1a6fa255b [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
17liblog_host_sources = [
18 "logd_write.c",
19 "log_event_write.c",
20 "fake_log_device.c",
21 //"event.logtags",
22]
23liblog_target_sources = [
24 "logd_write.c",
25 "log_event_write.c",
26 "event_tag_map.c",
27 "log_time.cpp",
28 "log_is_loggable.c",
29 "logprint.c",
30 "log_read.c",
31]
32
33// Shared and static library for host and device
34// ========================================================
35cc_library {
36 name: "liblog",
37 host_supported: true,
38
39 target: {
40 host: {
41 srcs: liblog_host_sources,
42 cflags: ["-DFAKE_LOG_DEVICE=1"],
43 },
44 android: {
45 srcs: liblog_target_sources,
46 // AddressSanitizer runtime library depends on liblog.
47 sanitize: ["never"],
48 },
49 android_arm: {
Dmitriy Ivanov58558a52015-09-28 10:40:35 -070050 // TODO: This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen63aa47a2015-09-16 15:54:14 -070051 ldflags: ["-Wl,--hash-style=both"],
52 },
53 windows: {
54 srcs: ["uio.c"],
Dan Willemsena3f41bf2015-11-30 15:35:09 -080055 enabled: true,
Dan Willemsen63aa47a2015-09-16 15:54:14 -070056 },
57 not_windows: {
58 srcs: ["event_tag_map.c"],
59 },
60 linux: {
61 host_ldlibs: ["-lrt"],
62 },
63 },
64
65 cflags: [
66 "-Werror",
67 // This is what we want to do:
68 // liblog_cflags := $(shell \
69 // sed -n \
70 // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \
71 // $(LOCAL_PATH)/event.logtags)
72 // so make sure we do not regret hard-coding it as follows:
73 "-DLIBLOG_LOG_TAG=1005",
Dan Willemsend68c35a2016-01-05 13:09:09 -080074 "-DSNET_EVENT_LOG_TAG=1397638484",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070075 ],
76 compile_multilib: "both",
77 stl: "none",
78}