| 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", | 
|  | 25 | clang: true, | 
|  | 26 | host_supported: true, | 
|  | 27 | srcs: [ | 
|  | 28 | "file.cpp", | 
|  | 29 | "logging.cpp", | 
|  | 30 | "parsenetaddress.cpp", | 
| Josh Gao | 0c44256 | 2016-09-13 14:50:57 -0700 | [diff] [blame] | 31 | "quick_exit.cpp", | 
| Colin Cross | fc06bd0 | 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"], | 
|  | 40 | target: { | 
|  | 41 | android: { | 
| Elliott Hughes | 1e88c8c | 2016-09-21 16:53:15 -0700 | [diff] [blame] | 42 | srcs: [ | 
|  | 43 | "errors_unix.cpp", | 
|  | 44 | "properties.cpp", | 
|  | 45 | ], | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 46 | cppflags: ["-Wexit-time-destructors"], | 
|  | 47 | }, | 
|  | 48 | darwin: { | 
|  | 49 | srcs: ["errors_unix.cpp"], | 
|  | 50 | cppflags: ["-Wexit-time-destructors"], | 
|  | 51 | }, | 
|  | 52 | linux: { | 
|  | 53 | srcs: ["errors_unix.cpp"], | 
|  | 54 | cppflags: ["-Wexit-time-destructors"], | 
|  | 55 | }, | 
|  | 56 | windows: { | 
|  | 57 | srcs: [ | 
|  | 58 | "errors_windows.cpp", | 
|  | 59 | "utf8.cpp", | 
|  | 60 | ], | 
|  | 61 | enabled: true, | 
|  | 62 | }, | 
|  | 63 | }, | 
|  | 64 | } | 
|  | 65 |  | 
|  | 66 | // Tests | 
|  | 67 | // ------------------------------------------------------------------------------ | 
|  | 68 | cc_test { | 
|  | 69 | name: "libbase_test", | 
|  | 70 | host_supported: true, | 
|  | 71 | clang: true, | 
|  | 72 | srcs: [ | 
|  | 73 | "errors_test.cpp", | 
|  | 74 | "file_test.cpp", | 
|  | 75 | "logging_test.cpp", | 
| Yabin Cui | 997cba4 | 2016-10-05 10:54:35 -0700 | [diff] [blame] | 76 | "parsedouble_test.cpp", | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 77 | "parseint_test.cpp", | 
|  | 78 | "parsenetaddress_test.cpp", | 
| Josh Gao | 0c44256 | 2016-09-13 14:50:57 -0700 | [diff] [blame] | 79 | "quick_exit_test.cpp", | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 80 | "stringprintf_test.cpp", | 
|  | 81 | "strings_test.cpp", | 
|  | 82 | "test_main.cpp", | 
|  | 83 | ], | 
|  | 84 | target: { | 
| Elliott Hughes | 1e88c8c | 2016-09-21 16:53:15 -0700 | [diff] [blame] | 85 | android: { | 
|  | 86 | srcs: ["properties_test.cpp"], | 
|  | 87 | }, | 
| Colin Cross | fc06bd0 | 2016-07-11 14:15:31 -0700 | [diff] [blame] | 88 | windows: { | 
|  | 89 | srcs: ["utf8_test.cpp"], | 
|  | 90 | enabled: true, | 
|  | 91 | }, | 
|  | 92 | }, | 
|  | 93 | local_include_dirs: ["."], | 
|  | 94 | cppflags: libbase_cppflags, | 
|  | 95 | shared_libs: ["libbase"], | 
|  | 96 | compile_multilib: "both", | 
|  | 97 | multilib: { | 
|  | 98 | lib32: { | 
|  | 99 | suffix: "32", | 
|  | 100 | }, | 
|  | 101 | lib64: { | 
|  | 102 | suffix: "64", | 
|  | 103 | }, | 
|  | 104 | }, | 
|  | 105 | } |