Home | History | Annotate | Download | only in base
      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 cc_defaults {
     18     name: "libbase_cflags_defaults",
     19     cflags: [
     20         "-Wall",
     21         "-Werror",
     22         "-Wextra",
     23     ],
     24 }
     25 
     26 cc_library_headers {
     27     name: "libbase_headers",
     28     vendor_available: true,
     29     host_supported: true,
     30     export_include_dirs: ["include"],
     31 
     32     target: {
     33         linux_bionic: {
     34             enabled: true,
     35         },
     36         windows: {
     37             enabled: true,
     38         },
     39     },
     40 }
     41 
     42 cc_defaults {
     43     name: "libbase_defaults",
     44     defaults: ["libbase_cflags_defaults"],
     45     srcs: [
     46         "chrono_utils.cpp",
     47         "file.cpp",
     48         "logging.cpp",
     49         "parsenetaddress.cpp",
     50         "quick_exit.cpp",
     51         "stringprintf.cpp",
     52         "strings.cpp",
     53         "test_utils.cpp",
     54     ],
     55 
     56     shared_libs: ["liblog"],
     57     target: {
     58         android: {
     59             srcs: [
     60                 "properties.cpp",
     61             ],
     62             sanitize: {
     63                 misc_undefined: ["integer"],
     64             },
     65 
     66         },
     67         linux: {
     68             srcs: [
     69                 "errors_unix.cpp",
     70             ],
     71             cppflags: ["-Wexit-time-destructors"],
     72         },
     73         darwin: {
     74             srcs: [
     75                 "errors_unix.cpp",
     76             ],
     77             cppflags: ["-Wexit-time-destructors"],
     78         },
     79         linux_bionic: {
     80             enabled: true,
     81         },
     82         windows: {
     83             srcs: [
     84                 "errors_windows.cpp",
     85                 "utf8.cpp",
     86             ],
     87             enabled: true,
     88         },
     89     },
     90 }
     91 
     92 cc_library {
     93     name: "libbase",
     94     defaults: ["libbase_defaults"],
     95     vendor_available: true,
     96     host_supported: true,
     97     vndk: {
     98         enabled: true,
     99         support_system_process: true,
    100     },
    101     header_libs: [
    102         "libbase_headers",
    103     ],
    104     export_header_lib_headers: ["libbase_headers"],
    105 }
    106 
    107 cc_library_static {
    108     name: "libbase_ndk",
    109     defaults: ["libbase_defaults"],
    110     sdk_version: "current",
    111     stl: "c++_static",
    112     export_include_dirs: ["include"],
    113 }
    114 
    115 // Tests
    116 // ------------------------------------------------------------------------------
    117 cc_test {
    118     name: "libbase_test",
    119     defaults: ["libbase_cflags_defaults"],
    120     host_supported: true,
    121     srcs: [
    122         "endian_test.cpp",
    123         "errors_test.cpp",
    124         "file_test.cpp",
    125         "logging_test.cpp",
    126         "parsedouble_test.cpp",
    127         "parseint_test.cpp",
    128         "parsenetaddress_test.cpp",
    129         "quick_exit_test.cpp",
    130         "scopeguard_test.cpp",
    131         "stringprintf_test.cpp",
    132         "strings_test.cpp",
    133         "test_main.cpp",
    134         "test_utils_test.cpp",
    135     ],
    136     target: {
    137         android: {
    138             srcs: ["properties_test.cpp"],
    139             sanitize: {
    140                 misc_undefined: ["integer"],
    141             },
    142         },
    143         linux: {
    144             srcs: ["chrono_utils_test.cpp"],
    145         },
    146         windows: {
    147             srcs: ["utf8_test.cpp"],
    148             cflags: ["-Wno-unused-parameter"],
    149             enabled: true,
    150         },
    151     },
    152     local_include_dirs: ["."],
    153     shared_libs: ["libbase"],
    154     compile_multilib: "both",
    155     multilib: {
    156         lib32: {
    157             suffix: "32",
    158         },
    159         lib64: {
    160             suffix: "64",
    161         },
    162     },
    163 }
    164