Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 1 | // |
| 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 | |
| 17 | liblog_host_sources = [ |
| 18 | "logd_write.c", |
| 19 | "log_event_write.c", |
| 20 | "fake_log_device.c", |
| 21 | //"event.logtags", |
| 22 | ] |
| 23 | liblog_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 | // ======================================================== |
| 35 | cc_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 Ivanov | 58558a5 | 2015-09-28 10:40:35 -0700 | [diff] [blame] | 50 | // TODO: This is to work around b/24465209. Remove after root cause is fixed |
Dan Willemsen | 63aa47a | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 51 | ldflags: ["-Wl,--hash-style=both"], |
| 52 | }, |
| 53 | windows: { |
| 54 | srcs: ["uio.c"], |
| 55 | }, |
| 56 | not_windows: { |
| 57 | srcs: ["event_tag_map.c"], |
| 58 | }, |
| 59 | linux: { |
| 60 | host_ldlibs: ["-lrt"], |
| 61 | }, |
| 62 | }, |
| 63 | |
| 64 | cflags: [ |
| 65 | "-Werror", |
| 66 | // This is what we want to do: |
| 67 | // liblog_cflags := $(shell \ |
| 68 | // sed -n \ |
| 69 | // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \ |
| 70 | // $(LOCAL_PATH)/event.logtags) |
| 71 | // so make sure we do not regret hard-coding it as follows: |
| 72 | "-DLIBLOG_LOG_TAG=1005", |
| 73 | ], |
| 74 | compile_multilib: "both", |
| 75 | stl: "none", |
| 76 | } |