Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2015 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 | libbase_cppflags = [ |
| 18 | "-Wall", |
| 19 | "-Wextra", |
| 20 | "-Werror", |
| 21 | ] |
| 22 | |
| 23 | cc_library { |
| 24 | name: "libbase", |
Steven Moreland | c28517f | 2017-04-13 15:13:57 -0700 | [diff] [blame^] | 25 | vendor_available: true, |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 26 | clang: true, |
| 27 | host_supported: true, |
| 28 | srcs: [ |
| 29 | "file.cpp", |
| 30 | "logging.cpp", |
| 31 | "parsenetaddress.cpp", |
Josh Gao | 0c44256 | 2016-09-13 14:50:57 -0700 | [diff] [blame] | 32 | "quick_exit.cpp", |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 33 | "stringprintf.cpp", |
| 34 | "strings.cpp", |
| 35 | "test_utils.cpp", |
| 36 | ], |
| 37 | local_include_dirs: ["include"], |
| 38 | cppflags: libbase_cppflags, |
| 39 | export_include_dirs: ["include"], |
| 40 | shared_libs: ["liblog"], |
Steven Moreland | c28517f | 2017-04-13 15:13:57 -0700 | [diff] [blame^] | 41 | header_libs: ["libutils_headers"], |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 42 | target: { |
| 43 | android: { |
Elliott Hughes | 1e88c8c | 2016-09-21 16:53:15 -0700 | [diff] [blame] | 44 | srcs: [ |
| 45 | "errors_unix.cpp", |
| 46 | "properties.cpp", |
| 47 | ], |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 48 | cppflags: ["-Wexit-time-destructors"], |
Elliott Hughes | ec46f4e | 2017-02-14 15:46:33 -0800 | [diff] [blame] | 49 | sanitize: { |
| 50 | misc_undefined: ["integer"], |
| 51 | }, |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 52 | }, |
| 53 | darwin: { |
James Hawkins | c8ac067 | 2017-02-14 19:20:20 +0000 | [diff] [blame] | 54 | srcs: ["errors_unix.cpp"], |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 55 | cppflags: ["-Wexit-time-destructors"], |
| 56 | }, |
Dan Willemsen | ab34b47 | 2016-11-29 13:32:55 -0800 | [diff] [blame] | 57 | linux_bionic: { |
James Hawkins | c8ac067 | 2017-02-14 19:20:20 +0000 | [diff] [blame] | 58 | srcs: ["errors_unix.cpp"], |
Dan Willemsen | ab34b47 | 2016-11-29 13:32:55 -0800 | [diff] [blame] | 59 | cppflags: ["-Wexit-time-destructors"], |
| 60 | enabled: true, |
| 61 | }, |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 62 | linux: { |
James Hawkins | c8ac067 | 2017-02-14 19:20:20 +0000 | [diff] [blame] | 63 | srcs: ["errors_unix.cpp"], |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 64 | cppflags: ["-Wexit-time-destructors"], |
| 65 | }, |
| 66 | windows: { |
| 67 | srcs: [ |
| 68 | "errors_windows.cpp", |
| 69 | "utf8.cpp", |
| 70 | ], |
| 71 | enabled: true, |
| 72 | }, |
| 73 | }, |
| 74 | } |
| 75 | |
| 76 | // Tests |
| 77 | // ------------------------------------------------------------------------------ |
| 78 | cc_test { |
| 79 | name: "libbase_test", |
| 80 | host_supported: true, |
| 81 | clang: true, |
| 82 | srcs: [ |
Elliott Hughes | 1dbd976 | 2017-02-24 14:02:05 -0800 | [diff] [blame] | 83 | "endian_test.cpp", |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 84 | "errors_test.cpp", |
| 85 | "file_test.cpp", |
| 86 | "logging_test.cpp", |
Yabin Cui | 997cba4 | 2016-10-05 10:54:35 -0700 | [diff] [blame] | 87 | "parsedouble_test.cpp", |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 88 | "parseint_test.cpp", |
| 89 | "parsenetaddress_test.cpp", |
Josh Gao | 0c44256 | 2016-09-13 14:50:57 -0700 | [diff] [blame] | 90 | "quick_exit_test.cpp", |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 91 | "stringprintf_test.cpp", |
| 92 | "strings_test.cpp", |
| 93 | "test_main.cpp", |
| 94 | ], |
| 95 | target: { |
Elliott Hughes | 1e88c8c | 2016-09-21 16:53:15 -0700 | [diff] [blame] | 96 | android: { |
James Hawkins | c8ac067 | 2017-02-14 19:20:20 +0000 | [diff] [blame] | 97 | srcs: ["properties_test.cpp"], |
Elliott Hughes | ec46f4e | 2017-02-14 15:46:33 -0800 | [diff] [blame] | 98 | sanitize: { |
| 99 | misc_undefined: ["integer"], |
| 100 | }, |
Elliott Hughes | 1e88c8c | 2016-09-21 16:53:15 -0700 | [diff] [blame] | 101 | }, |
Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 102 | windows: { |
| 103 | srcs: ["utf8_test.cpp"], |
| 104 | enabled: true, |
| 105 | }, |
| 106 | }, |
| 107 | local_include_dirs: ["."], |
| 108 | cppflags: libbase_cppflags, |
| 109 | shared_libs: ["libbase"], |
| 110 | compile_multilib: "both", |
| 111 | multilib: { |
| 112 | lib32: { |
| 113 | suffix: "32", |
| 114 | }, |
| 115 | lib64: { |
| 116 | suffix: "64", |
| 117 | }, |
| 118 | }, |
| 119 | } |