xref: /aosp_15_r20/external/pigweed/pw_thread/Android.bp (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1// Copyright 2023 The Pigweed Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License"); you may not
4// use this file except in compliance with the License. You may obtain a copy of
5// the License at
6//
7//     https://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, WITHOUT
11// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12// License for the specific language governing permissions and limitations under
13// the License.
14
15package {
16    default_applicable_licenses: ["external_pigweed_license"],
17}
18
19// To use the pw_thread facade, add it to the defaults list of the library or
20// binary that uses it, then include the pw_android_common_backends to the
21// defaults list, which adds the pw_thread_stl backend, or add include your
22// custom backend.
23cc_defaults {
24    name: "pw_thread",
25    cpp_std: "c++20",
26    header_libs: [
27        "pw_chrono",
28        "pw_thread_include_dirs",
29    ],
30    export_header_lib_headers: [
31        "pw_chrono",
32        "pw_thread_include_dirs",
33    ],
34    static_libs: [
35        "pw_function",
36        "pw_preprocessor",
37        "pw_status",
38    ],
39    srcs: [
40        ":pw_thread_src_files",
41    ],
42}
43
44// Do not include these since they are for the pw_thread cc_defaults. Depend on
45// the pw_thread facade instead.
46cc_library_headers {
47    name: "pw_thread_include_dirs",
48    cpp_std: "c++20",
49    export_include_dirs: [
50        "public",
51    ],
52    vendor_available: true,
53    host_supported: true,
54}
55
56// Do not include these since they are for the pw_thread cc_defaults. Depend on
57// the pw_thread facade instead.
58filegroup {
59    name: "pw_thread_src_files",
60    srcs: [
61        "sleep.cc",
62        "thread.cc",
63        "yield.cc",
64    ],
65}
66