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