1package { 2 default_applicable_licenses: ["Android-Apache-2.0"], 3} 4 5soong_config_module_type { 6 name: "lmkd_hooks_cc_defaults", 7 module_type: "cc_defaults", 8 config_namespace: "lmkd", 9 bool_variables: ["use_hooks"], 10 properties: [ 11 "cflags", 12 "static_libs", 13 ], 14} 15 16lmkd_hooks_cc_defaults { 17 name: "lmkd_hooks_defaults", 18 19 soong_config_variables: { 20 use_hooks: { 21 cflags: [ 22 "-DLMKD_USE_HOOKS" 23 ], 24 static_libs: [ 25 "liblmkdhooks" 26 ] 27 } 28 } 29} 30 31cc_defaults { 32 name: "stats_defaults", 33 cflags: [ 34 "-DLMKD_LOG_STATS" 35 ], 36} 37 38cc_binary { 39 name: "lmkd", 40 41 srcs: [ 42 "lmkd.cpp", 43 "reaper.cpp", 44 "watchdog.cpp", 45 ], 46 shared_libs: [ 47 "libcutils", 48 "liblog", 49 "libprocessgroup", 50 "libpsi", 51 ], 52 static_libs: [ 53 "libstatslogc", 54 "liblmkd_utils", 55 ], 56 header_libs: [ 57 "bpf_syscall_wrappers", 58 ], 59 local_include_dirs: ["include"], 60 cflags: [ 61 "-Wall", 62 "-Werror", 63 "-Wextra", 64 "-DLMKD_TRACE_KILLS" 65 ], 66 init_rc: ["lmkd.rc"], 67 defaults: ["stats_defaults", "lmkd_hooks_defaults"], 68 logtags: ["event.logtags"], 69 afdo: true, 70} 71 72cc_library_static { 73 name: "libstatslogc", 74 srcs: ["statslog.cpp"], 75 local_include_dirs: ["include"], 76 cflags: [ 77 "-Wall", 78 "-Werror", 79 "-Wextra", 80 ], 81 defaults: ["stats_defaults"], 82 shared_libs: [ 83 "liblog", 84 "libprocessgroup", 85 ], 86} 87 88cc_library_static { 89 name: "liblmkd_utils", 90 srcs: ["liblmkd_utils.cpp"], 91 recovery_available: true, 92 shared_libs: [ 93 "libcutils", 94 "libprocessgroup", 95 ], 96 export_include_dirs: ["include"], 97 cppflags: [ 98 "-g", 99 "-Wall", 100 "-Werror", 101 ] 102} 103