xref: /aosp_15_r20/system/core/libprocessgroup/Android.bp (revision 00c7fec1bb09f3284aad6a6f96d2f63dfc3650ad)
1package {
2    default_applicable_licenses: ["Android-Apache-2.0"],
3}
4
5soong_config_module_type {
6    name: "libprocessgroup_flag_aware_cc_defaults",
7    module_type: "cc_defaults",
8    config_namespace: "ANDROID",
9    bool_variables: [
10        "memcg_v2_force_enabled",
11        "cgroup_v2_sys_app_isolation",
12    ],
13    properties: [
14        "cflags",
15    ],
16}
17
18libprocessgroup_flag_aware_cc_defaults {
19    name: "libprocessgroup_build_flags_cc",
20    cpp_std: "gnu++23",
21    soong_config_variables: {
22        memcg_v2_force_enabled: {
23            cflags: [
24                "-DMEMCG_V2_FORCE_ENABLED=true",
25            ],
26        },
27        cgroup_v2_sys_app_isolation: {
28            cflags: [
29                "-DCGROUP_V2_SYS_APP_ISOLATION=true",
30            ],
31        },
32    },
33}
34
35cc_library_headers {
36    name: "libprocessgroup_headers",
37    vendor_available: true,
38    product_available: true,
39    ramdisk_available: true,
40    vendor_ramdisk_available: true,
41    recovery_available: true,
42    host_supported: true,
43    native_bridge_supported: true,
44    export_include_dirs: ["include"],
45    target: {
46        linux_bionic: {
47            enabled: true,
48        },
49        windows: {
50            enabled: true,
51        },
52    },
53    apex_available: [
54        "//apex_available:platform",
55        "//apex_available:anyapex",
56    ],
57    min_sdk_version: "29",
58}
59
60cc_library {
61    srcs: [
62        "cgroup_map.cpp",
63        "processgroup.cpp",
64        "sched_policy.cpp",
65        "task_profiles.cpp",
66    ],
67    name: "libprocessgroup",
68    host_supported: true,
69    native_bridge_supported: true,
70    ramdisk_available: true,
71    vendor_ramdisk_available: true,
72    recovery_available: true,
73    vendor_available: true,
74    product_available: true,
75    double_loadable: true,
76    shared_libs: [
77        "libbase",
78    ],
79    static_libs: [
80        "libjsoncpp",
81        "libprocessgroup_util",
82    ],
83    // for cutils/android_filesystem_config.h
84    header_libs: [
85        "libcutils_headers",
86        "libprocessgroup_headers",
87    ],
88    export_include_dirs: ["include"],
89    export_header_lib_headers: [
90        "libprocessgroup_headers",
91    ],
92    defaults: ["libprocessgroup_build_flags_cc"],
93    apex_available: [
94        "//apex_available:platform",
95        "//apex_available:anyapex",
96    ],
97    min_sdk_version: "29",
98}
99
100cc_test {
101    name: "task_profiles_test",
102    host_supported: true,
103    defaults: ["libprocessgroup_build_flags_cc"],
104    srcs: [
105        "task_profiles_test.cpp",
106    ],
107    header_libs: [
108        "libcutils_headers",
109        "libprocessgroup_headers",
110    ],
111    shared_libs: [
112        "libbase",
113        "libprocessgroup",
114    ],
115    static_libs: [
116        "libgmock",
117        "libprocessgroup_util",
118    ],
119}
120