Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 1 | // Copyright (C) 2008 The Android Open Source Project |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
Vijay Venkatraman | 75acc7b | 2017-01-05 10:39:38 -0800 | [diff] [blame] | 15 | cc_library_headers { |
| 16 | name: "libutils_headers", |
Steven Moreland | 48cdaff | 2017-04-11 12:43:16 -0700 | [diff] [blame] | 17 | vendor_available: true, |
Vijay Venkatraman | 75acc7b | 2017-01-05 10:39:38 -0800 | [diff] [blame] | 18 | host_supported: true, |
| 19 | export_include_dirs: ["include"], |
| 20 | target: { |
Dan Willemsen | e0cd1e0 | 2017-03-15 15:23:36 -0700 | [diff] [blame] | 21 | linux_bionic: { |
| 22 | enabled: true, |
| 23 | }, |
Vijay Venkatraman | 75acc7b | 2017-01-05 10:39:38 -0800 | [diff] [blame] | 24 | windows: { |
Dan Willemsen | e0cd1e0 | 2017-03-15 15:23:36 -0700 | [diff] [blame] | 25 | enabled: true, |
| 26 | }, |
Vijay Venkatraman | 75acc7b | 2017-01-05 10:39:38 -0800 | [diff] [blame] | 27 | }, |
| 28 | } |
| 29 | |
Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 30 | cc_library { |
| 31 | name: "libutils", |
Steven Moreland | 48cdaff | 2017-04-11 12:43:16 -0700 | [diff] [blame] | 32 | vendor_available: true, |
Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 33 | host_supported: true, |
| 34 | |
| 35 | srcs: [ |
| 36 | "CallStack.cpp", |
| 37 | "FileMap.cpp", |
| 38 | "JenkinsHash.cpp", |
| 39 | "LinearTransform.cpp", |
| 40 | "Log.cpp", |
| 41 | "NativeHandle.cpp", |
| 42 | "Printer.cpp", |
| 43 | "PropertyMap.cpp", |
| 44 | "RefBase.cpp", |
| 45 | "SharedBuffer.cpp", |
| 46 | "Static.cpp", |
| 47 | "StopWatch.cpp", |
| 48 | "String8.cpp", |
| 49 | "String16.cpp", |
Hans Boehm | 7f0b260 | 2017-03-15 11:01:03 -0700 | [diff] [blame] | 50 | "StrongPointer.cpp", |
Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 51 | "SystemClock.cpp", |
| 52 | "Threads.cpp", |
| 53 | "Timers.cpp", |
| 54 | "Tokenizer.cpp", |
| 55 | "Unicode.cpp", |
| 56 | "VectorImpl.cpp", |
| 57 | "misc.cpp", |
| 58 | ], |
| 59 | |
| 60 | cflags: ["-Werror"], |
| 61 | include_dirs: ["external/safe-iop/include"], |
Vijay Venkatraman | 75acc7b | 2017-01-05 10:39:38 -0800 | [diff] [blame] | 62 | header_libs: ["libutils_headers"], |
| 63 | export_header_lib_headers: ["libutils_headers"], |
Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 64 | |
| 65 | arch: { |
| 66 | mips: { |
| 67 | cflags: ["-DALIGN_DOUBLE"], |
| 68 | }, |
| 69 | }, |
| 70 | |
| 71 | target: { |
| 72 | android: { |
| 73 | srcs: [ |
| 74 | "BlobCache.cpp", |
| 75 | "Looper.cpp", |
| 76 | "ProcessCallStack.cpp", |
| 77 | "Trace.cpp", |
| 78 | ], |
| 79 | |
| 80 | cflags: ["-fvisibility=protected"], |
| 81 | |
| 82 | shared_libs: [ |
| 83 | "libbacktrace", |
| 84 | "libcutils", |
| 85 | "libdl", |
| 86 | "liblog", |
| 87 | ], |
Dan Willemsen | e16bdb1 | 2016-07-13 00:20:20 -0700 | [diff] [blame] | 88 | |
| 89 | sanitize: { |
| 90 | misc_undefined: ["integer"], |
| 91 | }, |
Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 92 | }, |
| 93 | |
| 94 | host: { |
| 95 | cflags: ["-DLIBUTILS_NATIVE=1"], |
| 96 | |
| 97 | shared: { |
| 98 | enabled: false, |
| 99 | }, |
| 100 | }, |
| 101 | |
| 102 | linux: { |
| 103 | srcs: [ |
| 104 | "Looper.cpp", |
| 105 | "ProcessCallStack.cpp", |
| 106 | ], |
| 107 | }, |
Dan Willemsen | ab34b47 | 2016-11-29 13:32:55 -0800 | [diff] [blame] | 108 | linux_bionic: { |
| 109 | enabled: true, |
| 110 | srcs: [ |
| 111 | "Looper.cpp", |
| 112 | "ProcessCallStack.cpp", |
| 113 | ], |
| 114 | }, |
Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 115 | |
| 116 | darwin: { |
| 117 | cflags: ["-Wno-unused-parameter"], |
| 118 | }, |
| 119 | |
| 120 | // Under MinGW, ctype.h doesn't need multi-byte support |
| 121 | windows: { |
| 122 | cflags: ["-DMB_CUR_MAX=1"], |
| 123 | |
| 124 | enabled: true, |
| 125 | }, |
| 126 | }, |
| 127 | |
| 128 | clang: true, |
Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 129 | } |
| 130 | |
| 131 | // Include subdirectory makefiles |
| 132 | // ============================================================ |
| 133 | |
| 134 | cc_test { |
| 135 | name: "SharedBufferTest", |
| 136 | host_supported: true, |
Colin Cross | 2fedbf7 | 2016-07-12 23:43:18 -0700 | [diff] [blame] | 137 | static_libs: ["libutils"], |
Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 138 | shared_libs: ["liblog"], |
| 139 | srcs: ["SharedBufferTest.cpp"], |
| 140 | } |
| 141 | |
| 142 | subdirs = ["tests"] |