xref: /aosp_15_r20/external/pthreadpool/Android.bp (revision b095b0533730c2930f947df924a4486d266faa1a)
1// Copyright (C) 2020 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_applicable_licenses: ["external_pthreadpool_license"],
17}
18
19// Added automatically by a large-scale-change
20// See: http://go/android-license-faq
21license {
22    name: "external_pthreadpool_license",
23    visibility: [":__subpackages__"],
24    license_kinds: [
25        "SPDX-license-identifier-BSD",
26    ],
27    license_text: [
28        "LICENSE",
29    ],
30}
31
32cc_library_static {
33    name: "libpthreadpool",
34    export_include_dirs: ["include"],
35    vendor_available: true,
36    sdk_version: "current",
37    srcs: [
38        "src/memory.c",
39        "src/portable-api.c",
40        "src/pthreads.c",
41    ],
42    cflags: [
43        "-O2",
44        "-Wno-deprecated-declarations",
45        "-Wno-missing-field-initializers",
46        "-Wno-unused-parameter",
47        "-DPTHREADPOOL_USE_CPUINFO=1",
48        "-DPTHREADPOOL_USE_CONDVAR=1",
49    ],
50    header_libs: [
51        "fxdiv_headers",
52    ],
53    shared_libs: [
54        "liblog",
55    ],
56    static_libs: [
57        "libcpuinfo",
58        "libclog",
59    ],
60}
61
62cc_test {
63    name: "PthreadPoolTests",
64    sdk_version: "current",
65    srcs: [
66        "test/pthreadpool.cc",
67    ],
68    cflags: [
69        "-Wno-unused-parameter",
70        "-Wno-missing-field-initializers",
71    ],
72    stl: "libc++_static",
73    shared_libs: [
74        "liblog",
75    ],
76    static_libs: [
77        "libclog",
78        "libcpuinfo",
79        "libgmock_ndk",
80        "libpthreadpool",
81    ],
82    test_suites: [
83        "general-tests",
84    ],
85}
86