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 | "log_event_list.cpp", |
| 19 | "log_event_write.cpp", |
Tom Cherry | f623f02 | 2019-01-10 10:37:36 -0800 | [diff] [blame] | 20 | "logger_name.cpp", |
| 21 | "logger_read.cpp", |
| 22 | "logger_write.cpp", |
| 23 | "logprint.cpp", |
Tom Cherry | c377c7d | 2020-01-27 15:45:52 -0800 | [diff] [blame] | 24 | "properties.cpp", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 25 | ] |
| 26 | liblog_target_sources = [ |
Mark Salyzyn | a409759 | 2016-11-21 12:00:03 -0800 | [diff] [blame] | 27 | "event_tag_map.cpp", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 28 | "log_time.cpp", |
Tom Cherry | f623f02 | 2019-01-10 10:37:36 -0800 | [diff] [blame] | 29 | "pmsg_reader.cpp", |
| 30 | "pmsg_writer.cpp", |
| 31 | "logd_reader.cpp", |
| 32 | "logd_writer.cpp", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 33 | ] |
| 34 | |
Steven Moreland | 5a5d263 | 2017-07-10 16:40:36 -0700 | [diff] [blame] | 35 | cc_library_headers { |
| 36 | name: "liblog_headers", |
| 37 | host_supported: true, |
| 38 | vendor_available: true, |
Yifan Hong | 336e179 | 2020-01-21 18:17:19 -0800 | [diff] [blame] | 39 | ramdisk_available: true, |
Yifan Hong | 0cc91e5 | 2020-10-21 18:51:44 -0700 | [diff] [blame] | 40 | vendor_ramdisk_available: true, |
Jiyong Park | ac945a2 | 2018-04-27 21:48:43 +0900 | [diff] [blame] | 41 | recovery_available: true, |
Jiyong Park | 416a40b | 2020-03-07 16:36:09 +0900 | [diff] [blame] | 42 | apex_available: [ |
| 43 | "//apex_available:platform", |
| 44 | "//apex_available:anyapex", |
| 45 | ], |
Jooyung Han | f17abbf | 2020-04-16 18:48:33 +0900 | [diff] [blame] | 46 | min_sdk_version: "29", |
Tom Cherry | 003b74d | 2020-09-17 14:30:25 -0700 | [diff] [blame] | 47 | sdk_version: "minimum", |
dimitry | 7bad46b | 2019-05-06 14:01:58 +0200 | [diff] [blame] | 48 | native_bridge_supported: true, |
Steven Moreland | 5a5d263 | 2017-07-10 16:40:36 -0700 | [diff] [blame] | 49 | export_include_dirs: ["include"], |
Elliott Hughes | 02f0e9c | 2019-02-13 12:42:06 -0800 | [diff] [blame] | 50 | system_shared_libs: [], |
| 51 | stl: "none", |
Steven Moreland | 5a5d263 | 2017-07-10 16:40:36 -0700 | [diff] [blame] | 52 | target: { |
| 53 | windows: { |
| 54 | enabled: true, |
| 55 | }, |
| 56 | linux_bionic: { |
| 57 | enabled: true, |
| 58 | }, |
| 59 | vendor: { |
Steven Moreland | 09e9026 | 2018-01-05 14:42:12 -0800 | [diff] [blame] | 60 | override_export_include_dirs: ["include_vndk"], |
Steven Moreland | 5a5d263 | 2017-07-10 16:40:36 -0700 | [diff] [blame] | 61 | }, |
| 62 | }, |
| 63 | } |
| 64 | |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 65 | // Shared and static library for host and device |
| 66 | // ======================================================== |
| 67 | cc_library { |
| 68 | name: "liblog", |
| 69 | host_supported: true, |
Yifan Hong | 336e179 | 2020-01-21 18:17:19 -0800 | [diff] [blame] | 70 | ramdisk_available: true, |
Yifan Hong | 3886994 | 2020-10-23 17:42:37 -0700 | [diff] [blame^] | 71 | vendor_ramdisk_available: true, |
Jiyong Park | ac945a2 | 2018-04-27 21:48:43 +0900 | [diff] [blame] | 72 | recovery_available: true, |
dimitry | 7bad46b | 2019-05-06 14:01:58 +0200 | [diff] [blame] | 73 | native_bridge_supported: true, |
Mark Salyzyn | 6cdd531 | 2016-03-01 13:45:42 -0800 | [diff] [blame] | 74 | srcs: liblog_sources, |
| 75 | |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 76 | target: { |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 77 | android: { |
Tom Cherry | d3c83f6 | 2019-01-17 11:38:31 -0800 | [diff] [blame] | 78 | version_script: "liblog.map.txt", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 79 | srcs: liblog_target_sources, |
| 80 | // AddressSanitizer runtime library depends on liblog. |
Colin Cross | d7b701c | 2016-04-07 13:30:22 -0700 | [diff] [blame] | 81 | sanitize: { |
Evgenii Stepanov | 3711561 | 2016-11-29 15:02:30 -0800 | [diff] [blame] | 82 | address: false, |
Colin Cross | d7b701c | 2016-04-07 13:30:22 -0700 | [diff] [blame] | 83 | }, |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 84 | }, |
Ian Pedowitz | 91d5a8a | 2018-01-18 16:25:24 -0800 | [diff] [blame] | 85 | android_arm: { |
| 86 | // 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] | 87 | pack_relocations: false, |
Ian Pedowitz | 91d5a8a | 2018-01-18 16:25:24 -0800 | [diff] [blame] | 88 | ldflags: ["-Wl,--hash-style=both"], |
| 89 | }, |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 90 | windows: { |
Dan Willemsen | 34a3d49 | 2015-11-30 15:35:09 -0800 | [diff] [blame] | 91 | enabled: true, |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 92 | }, |
| 93 | not_windows: { |
Mark Salyzyn | a409759 | 2016-11-21 12:00:03 -0800 | [diff] [blame] | 94 | srcs: ["event_tag_map.cpp"], |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 95 | }, |
Dan Willemsen | a00f44a | 2016-11-29 13:39:55 -0800 | [diff] [blame] | 96 | linux_bionic: { |
| 97 | enabled: true, |
| 98 | }, |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 99 | }, |
| 100 | |
Tom Cherry | e573fd2 | 2019-12-20 16:06:34 -0800 | [diff] [blame] | 101 | header_libs: [ |
| 102 | "libbase_headers", |
Tom Cherry | c52ed0b | 2020-09-17 09:38:42 -0700 | [diff] [blame] | 103 | "libcutils_headers", |
Tom Cherry | e573fd2 | 2019-12-20 16:06:34 -0800 | [diff] [blame] | 104 | "liblog_headers", |
| 105 | ], |
Steven Moreland | 5a5d263 | 2017-07-10 16:40:36 -0700 | [diff] [blame] | 106 | export_header_lib_headers: ["liblog_headers"], |
Vijay Venkatraman | d2cead5 | 2017-01-25 18:52:17 +0000 | [diff] [blame] | 107 | |
Tom Cherry | cc1701d | 2019-02-08 11:55:36 -0800 | [diff] [blame] | 108 | stubs: { |
| 109 | symbol_file: "liblog.map.txt", |
Chong Zhang | 3a82110 | 2020-01-15 13:58:13 -0800 | [diff] [blame] | 110 | versions: ["29", "30"], |
Tom Cherry | cc1701d | 2019-02-08 11:55:36 -0800 | [diff] [blame] | 111 | }, |
| 112 | |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 113 | cflags: [ |
Tom Cherry | 6646115 | 2019-09-30 12:58:55 -0700 | [diff] [blame] | 114 | "-Wall", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 115 | "-Werror", |
Tom Cherry | 6646115 | 2019-09-30 12:58:55 -0700 | [diff] [blame] | 116 | "-Wextra", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 117 | // This is what we want to do: |
| 118 | // liblog_cflags := $(shell \ |
| 119 | // sed -n \ |
| 120 | // 's/^\([0-9]*\)[ \t]*liblog[ \t].*/-DLIBLOG_LOG_TAG=\1/p' \ |
| 121 | // $(LOCAL_PATH)/event.logtags) |
| 122 | // so make sure we do not regret hard-coding it as follows: |
Mark Salyzyn | 74e408e | 2016-09-12 14:51:48 -0700 | [diff] [blame] | 123 | "-DLIBLOG_LOG_TAG=1006", |
Mark Salyzyn | 509c142 | 2016-03-25 15:50:46 -0700 | [diff] [blame] | 124 | "-DSNET_EVENT_LOG_TAG=1397638484", |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 125 | ], |
Dan Willemsen | 1fdb20d | 2016-06-01 15:32:35 -0700 | [diff] [blame] | 126 | logtags: ["event.logtags"], |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 127 | compile_multilib: "both", |
Jeffrey Huang | c0cbd46 | 2020-02-13 12:31:07 -0800 | [diff] [blame] | 128 | apex_available: [ |
Jeffrey Huang | c0cbd46 | 2020-02-13 12:31:07 -0800 | [diff] [blame] | 129 | "//apex_available:platform", |
Jiyong Park | c17e449 | 2020-03-09 14:35:57 +0900 | [diff] [blame] | 130 | // liblog is exceptionally available to the runtime APEX |
| 131 | // because the dynamic linker has to use it statically. |
| 132 | // See b/151051671 |
| 133 | "com.android.runtime", |
| 134 | // DO NOT add more apex names here |
Jeffrey Huang | c0cbd46 | 2020-02-13 12:31:07 -0800 | [diff] [blame] | 135 | ], |
Dan Willemsen | 489ca27 | 2015-09-16 15:54:14 -0700 | [diff] [blame] | 136 | } |
Dan Albert | 0eb04bf | 2016-09-23 15:43:23 -0700 | [diff] [blame] | 137 | |
Dan Albert | 6de176a | 2016-10-05 13:47:31 -0700 | [diff] [blame] | 138 | ndk_headers { |
Steven Moreland | 5a5d263 | 2017-07-10 16:40:36 -0700 | [diff] [blame] | 139 | name: "liblog_ndk_headers", |
Mark Salyzyn | 0ef234b | 2016-12-21 23:15:24 +0000 | [diff] [blame] | 140 | from: "include/android", |
Dan Albert | 6de176a | 2016-10-05 13:47:31 -0700 | [diff] [blame] | 141 | to: "android", |
Mark Salyzyn | 0ef234b | 2016-12-21 23:15:24 +0000 | [diff] [blame] | 142 | srcs: ["include/android/log.h"], |
Dan Albert | 17587a1 | 2016-10-20 10:18:27 -0700 | [diff] [blame] | 143 | license: "NOTICE", |
Dan Albert | 6de176a | 2016-10-05 13:47:31 -0700 | [diff] [blame] | 144 | } |
| 145 | |
Dan Albert | 0eb04bf | 2016-09-23 15:43:23 -0700 | [diff] [blame] | 146 | ndk_library { |
Dan Willemsen | b916d0f | 2017-04-07 15:26:08 -0700 | [diff] [blame] | 147 | name: "liblog", |
Dan Albert | 0eb04bf | 2016-09-23 15:43:23 -0700 | [diff] [blame] | 148 | symbol_file: "liblog.map.txt", |
| 149 | first_version: "9", |
Dan Albert | 89ebcb7 | 2017-01-05 15:55:49 -0800 | [diff] [blame] | 150 | unversioned_until: "current", |
Dan Albert | 0eb04bf | 2016-09-23 15:43:23 -0700 | [diff] [blame] | 151 | } |
Dan Willemsen | cf6ea4d | 2017-03-20 14:08:59 -0700 | [diff] [blame] | 152 | |
| 153 | llndk_library { |
Dan Willemsen | b916d0f | 2017-04-07 15:26:08 -0700 | [diff] [blame] | 154 | name: "liblog", |
dimitry | 7bad46b | 2019-05-06 14:01:58 +0200 | [diff] [blame] | 155 | native_bridge_supported: true, |
Dan Willemsen | cf6ea4d | 2017-03-20 14:08:59 -0700 | [diff] [blame] | 156 | symbol_file: "liblog.map.txt", |
Dan Willemsen | cf6ea4d | 2017-03-20 14:08:59 -0700 | [diff] [blame] | 157 | export_include_dirs: ["include_vndk"], |
| 158 | } |