Dan Willemsen | 489ca27 | 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 | |
Mark Salyzyn | 6cdd531 | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 17 | liblog_sources = [ |
Tom Cherry | f623f02 | 2019-01-10 10:37:36 -0800 | [diff] [blame^] | 18 | "config_read.cpp", |
| 19 | "config_write.cpp", |
| 20 | "log_event_list.cpp", |
| 21 | "log_event_write.cpp", |
Mark Salyzyn | eaece25 | 2016-12-14 12:52:50 -0800 | [diff] [blame] | 22 | "log_ratelimit.cpp", |
Tom Cherry | f623f02 | 2019-01-10 10:37:36 -0800 | [diff] [blame^] | 23 | "logger_lock.cpp", |
| 24 | "logger_name.cpp", |
| 25 | "logger_read.cpp", |
| 26 | "logger_write.cpp", |
| 27 | "logprint.cpp", |
| 28 | "stderr_write.cpp", |
Mark Salyzyn | 6cdd531 | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 29 | ] |
| 30 | liblog_host_sources = [ |
Tom Cherry | f623f02 | 2019-01-10 10:37:36 -0800 | [diff] [blame^] | 31 | "fake_log_device.cpp", |
| 32 | "fake_writer.cpp", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 33 | ] |
| 34 | liblog_target_sources = [ |
Mark Salyzyn | a409759 | 2016-11-21 12:00:03 -0800 | [diff] [blame] | 35 | "event_tag_map.cpp", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 36 | "log_time.cpp", |
Tom Cherry | f623f02 | 2019-01-10 10:37:36 -0800 | [diff] [blame^] | 37 | "properties.cpp", |
| 38 | "pmsg_reader.cpp", |
| 39 | "pmsg_writer.cpp", |
| 40 | "logd_reader.cpp", |
| 41 | "logd_writer.cpp", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 42 | ] |
| 43 | |
Steven Moreland | 5a5d263 | 2017-07-10 16:40:36 -0700 | [diff] [blame] | 44 | cc_library_headers { |
| 45 | name: "liblog_headers", |
| 46 | host_supported: true, |
| 47 | vendor_available: true, |
Jiyong Park | ac945a2 | 2018-04-27 21:48:43 +0900 | [diff] [blame] | 48 | recovery_available: true, |
Steven Moreland | 5a5d263 | 2017-07-10 16:40:36 -0700 | [diff] [blame] | 49 | export_include_dirs: ["include"], |
| 50 | target: { |
| 51 | windows: { |
| 52 | enabled: true, |
| 53 | }, |
| 54 | linux_bionic: { |
| 55 | enabled: true, |
| 56 | }, |
| 57 | vendor: { |
Steven Moreland | 09e9026 | 2018-01-05 14:42:12 -0800 | [diff] [blame] | 58 | override_export_include_dirs: ["include_vndk"], |
Steven Moreland | 5a5d263 | 2017-07-10 16:40:36 -0700 | [diff] [blame] | 59 | }, |
| 60 | }, |
| 61 | } |
| 62 | |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 63 | // Shared and static library for host and device |
| 64 | // ======================================================== |
| 65 | cc_library { |
| 66 | name: "liblog", |
| 67 | host_supported: true, |
Jiyong Park | ac945a2 | 2018-04-27 21:48:43 +0900 | [diff] [blame] | 68 | recovery_available: true, |
Mark Salyzyn | 6cdd531 | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 69 | srcs: liblog_sources, |
| 70 | |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 71 | target: { |
| 72 | host: { |
| 73 | srcs: liblog_host_sources, |
| 74 | cflags: ["-DFAKE_LOG_DEVICE=1"], |
| 75 | }, |
| 76 | android: { |
| 77 | srcs: liblog_target_sources, |
| 78 | // AddressSanitizer runtime library depends on liblog. |
Colin Cross | d7b701c | 2016-04-07 13:30:22 -0700 | [diff] [blame] | 79 | sanitize: { |
Evgenii Stepanov | 3711561 | 2016-11-29 15:02:30 -0800 | [diff] [blame] | 80 | address: false, |
Colin Cross | d7b701c | 2016-04-07 13:30:22 -0700 | [diff] [blame] | 81 | }, |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 82 | }, |
Ian Pedowitz | 91d5a8a | 2018-01-18 16:25:24 -0800 | [diff] [blame] | 83 | android_arm: { |
| 84 | // TODO: This is to work around b/24465209. Remove after root cause is fixed |
Chih-Hung Hsieh | 0f8e137 | 2018-05-23 18:55:10 -0700 | [diff] [blame] | 85 | pack_relocations: false, |
Ian Pedowitz | 91d5a8a | 2018-01-18 16:25:24 -0800 | [diff] [blame] | 86 | ldflags: ["-Wl,--hash-style=both"], |
| 87 | }, |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 88 | windows: { |
Tom Cherry | f623f02 | 2019-01-10 10:37:36 -0800 | [diff] [blame^] | 89 | srcs: ["uio.cpp"], |
Dan Willemsen | 34a3d49 | 2015-11-30 15:35:09 -0800 | [diff] [blame] | 90 | enabled: true, |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 91 | }, |
| 92 | not_windows: { |
Mark Salyzyn | a409759 | 2016-11-21 12:00:03 -0800 | [diff] [blame] | 93 | srcs: ["event_tag_map.cpp"], |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 94 | }, |
Dan Willemsen | a00f44a | 2016-11-29 13:39:55 -0800 | [diff] [blame] | 95 | linux_bionic: { |
| 96 | enabled: true, |
| 97 | }, |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 98 | }, |
| 99 | |
Steven Moreland | 5a5d263 | 2017-07-10 16:40:36 -0700 | [diff] [blame] | 100 | header_libs: ["liblog_headers"], |
| 101 | export_header_lib_headers: ["liblog_headers"], |
Vijay Venkatraman | d2cead5 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 102 | |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 103 | cflags: [ |
| 104 | "-Werror", |
Mark Salyzyn | 6cdd531 | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 105 | "-fvisibility=hidden", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 106 | // This is what we want to do: |
| 107 | // liblog_cflags := $(shell \ |
| 108 | // sed -n \ |
| 109 | // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \ |
| 110 | // $(LOCAL_PATH)/event.logtags) |
| 111 | // so make sure we do not regret hard-coding it as follows: |
Mark Salyzyn | 74e408e | 2016-09-12 14:51:48 -0700 | [diff] [blame] | 112 | "-DLIBLOG_LOG_TAG=1006", |
Mark Salyzyn | 509c142 | 2016-03-25 15:50:46 -0700 | [diff] [blame] | 113 | "-DSNET_EVENT_LOG_TAG=1397638484", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 114 | ], |
Dan Willemsen | 1fdb20d | 2016-06-01 15:32:35 -0700 | [diff] [blame] | 115 | logtags: ["event.logtags"], |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 116 | compile_multilib: "both", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 117 | } |
Dan Albert | 0eb04bf | 2016-09-23 15:43:23 -0700 | [diff] [blame] | 118 | |
Dan Albert | 6de176a | 2016-10-05 13:47:31 -0700 | [diff] [blame] | 119 | ndk_headers { |
Steven Moreland | 5a5d263 | 2017-07-10 16:40:36 -0700 | [diff] [blame] | 120 | name: "liblog_ndk_headers", |
Mark Salyzyn | 0ef234b | 2016-12-21 23:15:24 +0000 | [diff] [blame] | 121 | from: "include/android", |
Dan Albert | 6de176a | 2016-10-05 13:47:31 -0700 | [diff] [blame] | 122 | to: "android", |
Mark Salyzyn | 0ef234b | 2016-12-21 23:15:24 +0000 | [diff] [blame] | 123 | srcs: ["include/android/log.h"], |
Dan Albert | 17587a1 | 2016-10-20 10:18:27 -0700 | [diff] [blame] | 124 | license: "NOTICE", |
Dan Albert | 6de176a | 2016-10-05 13:47:31 -0700 | [diff] [blame] | 125 | } |
| 126 | |
Dan Albert | 0eb04bf | 2016-09-23 15:43:23 -0700 | [diff] [blame] | 127 | ndk_library { |
Dan Willemsen | b916d0f | 2017-04-07 15:26:08 -0700 | [diff] [blame] | 128 | name: "liblog", |
Dan Albert | 0eb04bf | 2016-09-23 15:43:23 -0700 | [diff] [blame] | 129 | symbol_file: "liblog.map.txt", |
| 130 | first_version: "9", |
Dan Albert | 89ebcb7 | 2017-01-05 15:55:49 -0800 | [diff] [blame] | 131 | unversioned_until: "current", |
Dan Albert | 0eb04bf | 2016-09-23 15:43:23 -0700 | [diff] [blame] | 132 | } |
Dan Willemsen | cf6ea4d | 2017-03-20 14:08:59 -0700 | [diff] [blame] | 133 | |
| 134 | llndk_library { |
Dan Willemsen | b916d0f | 2017-04-07 15:26:08 -0700 | [diff] [blame] | 135 | name: "liblog", |
Dan Willemsen | cf6ea4d | 2017-03-20 14:08:59 -0700 | [diff] [blame] | 136 | symbol_file: "liblog.map.txt", |
| 137 | unversioned: true, |
| 138 | export_include_dirs: ["include_vndk"], |
| 139 | } |