blob: 607d667bf90c3a5ae2a0a15444f94817cd79183d [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 Willemsen63aa47a2015-09-16 15:54:14 -070018 "logd_write.c",
Dan Willemsen7d5457e2016-02-29 10:46:18 -080019 "log_event_list.c",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070020 "log_event_write.c",
Dan Willemsen7d5457e2016-02-29 10:46:18 -080021]
22liblog_host_sources = [
Dan Willemsen63aa47a2015-09-16 15:54:14 -070023 "fake_log_device.c",
24 //"event.logtags",
25]
26liblog_target_sources = [
Dan Willemsen63aa47a2015-09-16 15:54:14 -070027 "event_tag_map.c",
28 "log_time.cpp",
29 "log_is_loggable.c",
30 "logprint.c",
31 "log_read.c",
32]
33
34// Shared and static library for host and device
35// ========================================================
36cc_library {
37 name: "liblog",
38 host_supported: true,
39
Dan Willemsen7d5457e2016-02-29 10:46:18 -080040 srcs: liblog_sources,
41
Dan Willemsen63aa47a2015-09-16 15:54:14 -070042 target: {
43 host: {
44 srcs: liblog_host_sources,
45 cflags: ["-DFAKE_LOG_DEVICE=1"],
46 },
47 android: {
48 srcs: liblog_target_sources,
49 // AddressSanitizer runtime library depends on liblog.
50 sanitize: ["never"],
51 },
52 android_arm: {
Dmitriy Ivanov58558a52015-09-28 10:40:35 -070053 // TODO: This is to work around b/24465209. Remove after root cause is fixed
Dan Willemsen63aa47a2015-09-16 15:54:14 -070054 ldflags: ["-Wl,--hash-style=both"],
55 },
56 windows: {
57 srcs: ["uio.c"],
Dan Willemsena3f41bf2015-11-30 15:35:09 -080058 enabled: true,
Dan Willemsen63aa47a2015-09-16 15:54:14 -070059 },
60 not_windows: {
61 srcs: ["event_tag_map.c"],
62 },
63 linux: {
64 host_ldlibs: ["-lrt"],
65 },
66 },
67
68 cflags: [
69 "-Werror",
70 // This is what we want to do:
71 // liblog_cflags := $(shell \
72 // sed -n \
73 // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \
74 // $(LOCAL_PATH)/event.logtags)
75 // so make sure we do not regret hard-coding it as follows:
76 "-DLIBLOG_LOG_TAG=1005",
Dan Willemsen63aa47a2015-09-16 15:54:14 -070077 ],
78 compile_multilib: "both",
79 stl: "none",
80}