Bob Badour | 1001746 | 2021-02-12 18:20:34 -0800 | [diff] [blame] | 1 | package { |
| 2 | default_applicable_licenses: ["external_fmtlib_license"], |
| 3 | } |
| 4 | |
| 5 | // Added automatically by a large-scale-change that took the approach of |
| 6 | // 'apply every license found to every target'. While this makes sure we respect |
| 7 | // every license restriction, it may not be entirely correct. |
| 8 | // |
| 9 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 10 | // |
| 11 | // Please consider splitting the single license below into multiple licenses, |
| 12 | // taking care not to lose any license_kind information, and overriding the |
| 13 | // default license using the 'licenses: [...]' property on targets as needed. |
| 14 | // |
| 15 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| 16 | // to attach the license to, and including a comment whether the files may be |
| 17 | // used in the current project. |
| 18 | // |
| 19 | // large-scale-change included anything that looked like it might be a license |
| 20 | // text as a license_text. e.g. LICENSE, NOTICE, COPYING etc. |
| 21 | // |
| 22 | // Please consider removing redundant or irrelevant files from 'license_text:'. |
| 23 | // See: http://go/android-license-faq |
| 24 | license { |
| 25 | name: "external_fmtlib_license", |
| 26 | visibility: [":__subpackages__"], |
| 27 | license_kinds: [ |
| 28 | "SPDX-license-identifier-BSD", |
| 29 | "SPDX-license-identifier-CC0-1.0", |
| 30 | "SPDX-license-identifier-MIT", |
| 31 | "SPDX-license-identifier-PSF-2.0", |
| 32 | "legacy_unencumbered", |
| 33 | ], |
| 34 | license_text: [ |
| 35 | "LICENSE.rst", |
| 36 | "NOTICE", |
| 37 | ], |
| 38 | } |
| 39 | |
Jiyong Park | 990e7f4 | 2019-06-12 16:25:51 +0900 | [diff] [blame] | 40 | cc_defaults { |
Elliott Hughes | c2c29c4 | 2020-11-03 12:18:33 -0800 | [diff] [blame] | 41 | name: "fmtlib-non-test-defaults", |
Jiyong Park | 9a4ce48 | 2019-06-12 01:15:08 +0900 | [diff] [blame] | 42 | cflags: [ |
| 43 | "-fno-exceptions", |
Jiyong Park | 9a4ce48 | 2019-06-12 01:15:08 +0900 | [diff] [blame] | 44 | // If built without exceptions, libfmt uses assert. |
Elliott Hughes | c2c29c4 | 2020-11-03 12:18:33 -0800 | [diff] [blame] | 45 | // The tests *require* exceptions, so we can't win here. |
| 46 | // (This is also why we have two cc_defaults in this file.) |
| 47 | // Unless proven to be a bad idea, let's at least have some run-time |
| 48 | // checking. |
Jiyong Park | 9a4ce48 | 2019-06-12 01:15:08 +0900 | [diff] [blame] | 49 | "-UNDEBUG", |
| 50 | ], |
Elliott Hughes | c2c29c4 | 2020-11-03 12:18:33 -0800 | [diff] [blame] | 51 | srcs: ["src/format.cc"], |
Jiyong Park | b3dda44 | 2019-06-12 01:20:18 +0900 | [diff] [blame] | 52 | local_include_dirs: ["include"], |
| 53 | export_include_dirs: ["include"], |
Elliott Hughes | c2c29c4 | 2020-11-03 12:18:33 -0800 | [diff] [blame] | 54 | visibility: ["//system/libbase"], |
Nikita Ioffe | 1a2a7fe | 2020-10-28 00:47:14 +0000 | [diff] [blame] | 55 | min_sdk_version: "29", |
Jiyong Park | 9a4ce48 | 2019-06-12 01:15:08 +0900 | [diff] [blame] | 56 | } |
Jiyong Park | 990e7f4 | 2019-06-12 16:25:51 +0900 | [diff] [blame] | 57 | |
Tom Cherry | 17b3fc8 | 2019-06-14 11:14:42 -0700 | [diff] [blame] | 58 | // This is built into libbase. If you want to use this library, link to libbase instead. |
| 59 | cc_library_static { |
Jiyong Park | 990e7f4 | 2019-06-12 16:25:51 +0900 | [diff] [blame] | 60 | name: "fmtlib", |
Elliott Hughes | c2c29c4 | 2020-11-03 12:18:33 -0800 | [diff] [blame] | 61 | defaults: ["fmtlib-non-test-defaults"], |
| 62 | |
Jiyong Park | 990e7f4 | 2019-06-12 16:25:51 +0900 | [diff] [blame] | 63 | vendor_available: true, |
Justin Yun | d6904de | 2020-11-11 16:18:39 +0900 | [diff] [blame] | 64 | product_available: true, |
Yifan Hong | cd5c038 | 2020-01-21 19:31:11 -0800 | [diff] [blame] | 65 | ramdisk_available: true, |
Yifan Hong | d0f3cdc | 2020-10-21 18:27:43 -0700 | [diff] [blame] | 66 | vendor_ramdisk_available: true, |
Jiyong Park | 990e7f4 | 2019-06-12 16:25:51 +0900 | [diff] [blame] | 67 | recovery_available: true, |
| 68 | host_supported: true, |
| 69 | native_bridge_supported: true, |
| 70 | target: { |
| 71 | linux_bionic: { |
| 72 | enabled: true, |
| 73 | }, |
| 74 | windows: { |
| 75 | enabled: true, |
| 76 | }, |
| 77 | }, |
Przemyslaw Szczepaniak | 2a2cc70 | 2020-02-10 13:32:14 +0000 | [diff] [blame] | 78 | apex_available: [ |
Jiyong Park | a9d1870 | 2020-03-07 16:37:23 +0900 | [diff] [blame] | 79 | "//apex_available:anyapex", |
Przemyslaw Szczepaniak | 2a2cc70 | 2020-02-10 13:32:14 +0000 | [diff] [blame] | 80 | "//apex_available:platform", |
Przemyslaw Szczepaniak | 2a2cc70 | 2020-02-10 13:32:14 +0000 | [diff] [blame] | 81 | ], |
Jiyong Park | 990e7f4 | 2019-06-12 16:25:51 +0900 | [diff] [blame] | 82 | } |
| 83 | |
| 84 | cc_library_static { |
| 85 | name: "fmtlib_ndk", |
Elliott Hughes | c2c29c4 | 2020-11-03 12:18:33 -0800 | [diff] [blame] | 86 | defaults: ["fmtlib-non-test-defaults"], |
Jiyong Park | 990e7f4 | 2019-06-12 16:25:51 +0900 | [diff] [blame] | 87 | sdk_version: "current", |
| 88 | stl: "c++_static", |
| 89 | } |
Elliott Hughes | c2c29c4 | 2020-11-03 12:18:33 -0800 | [diff] [blame] | 90 | |
| 91 | cc_defaults { |
| 92 | name: "fmtlib-test-defaults", |
| 93 | srcs: [ |
| 94 | "src/format.cc", |
| 95 | "src/os.cc", |
| 96 | "test/gtest-extra.cc", |
| 97 | "test/util.cc", |
| 98 | ], |
| 99 | local_include_dirs: ["include"], |
| 100 | host_supported: true, |
| 101 | test_suites: ["general-tests"], |
| 102 | // The tests require exceptions and RTTI. |
| 103 | cflags: ["-fexceptions"], |
| 104 | rtti: true, |
| 105 | // The usual "gtest *and* gmock, please" dance... |
| 106 | gtest: false, |
| 107 | include_dirs: [ |
| 108 | "external/googletest/googlemock/include/gmock", |
| 109 | "external/googletest/googletest/include/gtest", |
| 110 | ], |
| 111 | static_libs: [ |
| 112 | "libgmock", |
| 113 | "libgtest", |
| 114 | "libgtest_main", |
| 115 | ], |
| 116 | } |
| 117 | |
| 118 | // Most of the fmtlib tests. |
| 119 | cc_test { |
| 120 | name: "fmtlib_test", |
| 121 | defaults: ["fmtlib-test-defaults"], |
| 122 | srcs: [ |
| 123 | "test/chrono-test.cc", |
| 124 | "test/color-test.cc", |
| 125 | "test/core-test.cc", |
| 126 | "test/format-test.cc", |
| 127 | // Some of the os-test tests deliberately try to do bad things with |
| 128 | // file descriptors, but Android's fdsan won't let them. |
| 129 | // "test/os-test.cc", |
| 130 | "test/printf-test.cc", |
| 131 | "test/ranges-test.cc", |
| 132 | "test/scan-test.cc", |
| 133 | ], |
| 134 | } |
| 135 | |
| 136 | // This one needs to be separate because some of the test names overlap with |
| 137 | // other tests. |
| 138 | cc_test { |
| 139 | name: "fmtlib_ostream_test", |
| 140 | defaults: ["fmtlib-test-defaults"], |
| 141 | srcs: ["test/ostream-test.cc"], |
| 142 | } |