Miao Wang | c5ceb72 | 2020-02-10 15:02:41 -0800 | [diff] [blame] | 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 | |
| 15 | cc_library_static { |
| 16 | name: "libpthreadpool", |
| 17 | export_include_dirs: ["include"], |
| 18 | vendor_available: true, |
| 19 | sdk_version: "current", |
| 20 | srcs: [ |
Haibo Huang | 50c19eb | 2020-05-01 18:45:14 -0700 | [diff] [blame^] | 21 | "src/memory.c", |
| 22 | "src/portable-api.c", |
| 23 | "src/pthreads.c", |
Miao Wang | c5ceb72 | 2020-02-10 15:02:41 -0800 | [diff] [blame] | 24 | ], |
| 25 | cflags: [ |
Miao Wang | c5ceb72 | 2020-02-10 15:02:41 -0800 | [diff] [blame] | 26 | "-O2", |
| 27 | "-Wno-deprecated-declarations", |
| 28 | "-Wno-missing-field-initializers", |
Haibo Huang | 50c19eb | 2020-05-01 18:45:14 -0700 | [diff] [blame^] | 29 | "-DPTHREADPOOL_USE_CPUINFO=1", |
| 30 | "-DPTHREADPOOL_USE_CONDVAR=1", |
Miao Wang | c5ceb72 | 2020-02-10 15:02:41 -0800 | [diff] [blame] | 31 | ], |
Haibo Huang | 50c19eb | 2020-05-01 18:45:14 -0700 | [diff] [blame^] | 32 | c_std: "gnu11", |
Miao Wang | c5ceb72 | 2020-02-10 15:02:41 -0800 | [diff] [blame] | 33 | header_libs: [ |
| 34 | "fxdiv_headers", |
| 35 | ], |
Haibo Huang | 50c19eb | 2020-05-01 18:45:14 -0700 | [diff] [blame^] | 36 | shared_libs: [ |
| 37 | "liblog", |
| 38 | ], |
| 39 | static_libs: [ |
| 40 | "libcpuinfo", |
| 41 | "libclog", |
| 42 | ], |
Miao Wang | c5ceb72 | 2020-02-10 15:02:41 -0800 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | cc_test { |
| 46 | name: "PthreadPoolTests", |
| 47 | sdk_version: "current", |
| 48 | srcs: [ |
| 49 | "test/pthreadpool.cc", |
| 50 | ], |
| 51 | cflags: [ |
| 52 | "-Wno-unused-parameter", |
| 53 | "-Wno-missing-field-initializers", |
| 54 | ], |
| 55 | stl: "libc++_static", |
Haibo Huang | 50c19eb | 2020-05-01 18:45:14 -0700 | [diff] [blame^] | 56 | shared_libs: [ |
| 57 | "liblog", |
| 58 | ], |
Miao Wang | c5ceb72 | 2020-02-10 15:02:41 -0800 | [diff] [blame] | 59 | static_libs: [ |
Haibo Huang | 50c19eb | 2020-05-01 18:45:14 -0700 | [diff] [blame^] | 60 | "libclog", |
| 61 | "libcpuinfo", |
Miao Wang | c5ceb72 | 2020-02-10 15:02:41 -0800 | [diff] [blame] | 62 | "libgmock_ndk", |
| 63 | "libpthreadpool", |
| 64 | ], |
| 65 | test_suites: [ |
| 66 | "general-tests", |
| 67 | ], |
| 68 | } |
| 69 | |