blob: eb03cd8e9ae63fb75965cab2206494fc1b0b58cb [file] [log] [blame]
Dan Willemsend0dbccb2016-08-01 23:43:42 -07001// Copyright (C) 2015 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
Chih-Hung Hsiehe39c5302017-09-28 13:39:39 -070015cc_defaults {
16 name: "libcap_defaults",
17 cflags: [
18 "-Wall",
19 "-Werror",
20 "-Wno-unused-parameter",
21 "-Wno-unused-result",
22 "-Wno-tautological-compare",
23 ],
24}
25
Dan Willemsend0dbccb2016-08-01 23:43:42 -070026cc_library {
27 name: "libcap",
Dan Willemsend0dbccb2016-08-01 23:43:42 -070028 host_supported: true,
Jiyong Park9c588102017-04-25 16:56:25 +090029 vendor_available: true,
Jiyong Parka63cdda2018-05-24 14:08:14 +090030 recovery_available: true,
Justin Yund05a95e2017-07-24 15:19:44 +090031 vndk: {
32 enabled: true,
33 },
Chih-Hung Hsiehe39c5302017-09-28 13:39:39 -070034 defaults: ["libcap_defaults"],
Dan Willemsend0dbccb2016-08-01 23:43:42 -070035
36 srcs: [
37 "libcap/cap_alloc.c",
38 "libcap/cap_extint.c",
39 "libcap/cap_file.c",
40 "libcap/cap_flag.c",
41 "libcap/cap_proc.c",
42 "libcap/cap_text.c",
43 ],
44
45 local_include_dirs: ["libcap/include"],
46 export_include_dirs: ["libcap/include"],
47
48 target: {
49 darwin: {
50 enabled: false,
Tom Cherry64dcb222017-05-09 16:38:39 -070051 },
52 linux_bionic: {
53 enabled: true,
54 },
Haibo Huangd29d5072020-04-09 15:35:15 -070055 linux_glibc: {
56 local_include_dirs: ["libcap/include/uapi"],
57 },
Tom Cherry64dcb222017-05-09 16:38:39 -070058 },
Jiyong Park4eca36a2020-04-08 22:36:47 +090059 apex_available: [
Jooyung Han32563b82020-04-16 18:48:27 +090060 "//apex_available:platform",
61 "com.android.adbd",
62 "com.android.media.swcodec",
Jiyong Park4eca36a2020-04-08 22:36:47 +090063 ],
Jooyung Han32563b82020-04-16 18:48:27 +090064 min_sdk_version: "29",
Dan Willemsend0dbccb2016-08-01 23:43:42 -070065}
liminghao5e044e02016-11-15 16:28:23 +080066
67cc_binary {
68 name: "getcap",
liminghao5e044e02016-11-15 16:28:23 +080069
70 srcs: ["progs/getcap.c"],
71
Chih-Hung Hsiehe39c5302017-09-28 13:39:39 -070072 defaults: ["libcap_defaults"],
liminghao5e044e02016-11-15 16:28:23 +080073
74 static_libs: [
75 "libcap",
76 ],
77}
78
79cc_binary {
80 name: "setcap",
liminghao5e044e02016-11-15 16:28:23 +080081
82 srcs: ["progs/setcap.c"],
83
Chih-Hung Hsiehe39c5302017-09-28 13:39:39 -070084 defaults: ["libcap_defaults"],
liminghao5e044e02016-11-15 16:28:23 +080085
86 static_libs: [
87 "libcap",
88 ],
89}