Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 1 | cc_defaults { |
| 2 | name: "vold_default_flags", |
| 3 | |
| 4 | cflags: [ |
| 5 | "-Wall", |
| 6 | "-Werror", |
| 7 | "-Wextra", |
| 8 | "-Wno-missing-field-initializers", |
| 9 | "-Wno-unused-parameter", |
| 10 | "-Wno-unused-variable", |
| 11 | ], |
| 12 | |
| 13 | clang: true, |
| 14 | |
| 15 | tidy: true, |
| 16 | tidy_checks: [ |
| 17 | "-*", |
| 18 | "cert-*", |
| 19 | "clang-analyzer-security*", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 20 | ], |
| 21 | tidy_flags: [ |
| 22 | "-warnings-as-errors=clang-analyzer-security*,cert-*", |
| 23 | ], |
| 24 | } |
| 25 | |
| 26 | cc_defaults { |
| 27 | name: "vold_default_libs", |
| 28 | |
| 29 | static_libs: [ |
| 30 | "libavb", |
| 31 | "libbootloader_message", |
| 32 | "libfec", |
| 33 | "libfec_rs", |
| 34 | "libfs_mgr", |
| 35 | "libscrypt_static", |
| 36 | "libsquashfs_utils", |
| 37 | "libvold_binder", |
| 38 | ], |
| 39 | shared_libs: [ |
| 40 | "android.hardware.keymaster@3.0", |
| 41 | "libbase", |
| 42 | "libbinder", |
| 43 | "libcrypto", |
| 44 | "libcrypto_utils", |
| 45 | "libcutils", |
| 46 | "libdiskconfig", |
| 47 | "libext4_utils", |
| 48 | "libf2fs_sparseblock", |
| 49 | "libhardware", |
| 50 | "libhardware_legacy", |
| 51 | "libhidlbase", |
| 52 | "libhwbinder", |
| 53 | "libkeystore_binder", |
| 54 | "libkeyutils", |
| 55 | "liblog", |
| 56 | "liblogwrap", |
| 57 | "libselinux", |
| 58 | "libsysutils", |
| 59 | "libutils", |
| 60 | ], |
| 61 | } |
| 62 | |
| 63 | cc_library_static { |
| 64 | name: "libvold_binder", |
| 65 | defaults: ["vold_default_flags"], |
| 66 | |
| 67 | srcs: [ |
| 68 | "binder/android/os/IVold.aidl", |
| 69 | "binder/android/os/IVoldListener.aidl", |
| 70 | "binder/android/os/IVoldTaskListener.aidl", |
| 71 | ], |
| 72 | shared_libs: [ |
| 73 | "libbinder", |
| 74 | "libutils", |
| 75 | ], |
| 76 | aidl: { |
| 77 | local_include_dirs: ["binder"], |
| 78 | include_dirs: ["frameworks/native/aidl/binder"], |
| 79 | export_aidl_headers: true, |
| 80 | }, |
| 81 | } |
| 82 | |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame^] | 83 | cc_library_headers { |
| 84 | name: "libvold_headers", |
| 85 | export_include_dirs: ["."], |
| 86 | } |
| 87 | |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 88 | // Static library factored out to support testing |
| 89 | cc_library_static { |
| 90 | name: "libvold", |
| 91 | defaults: [ |
| 92 | "vold_default_flags", |
| 93 | "vold_default_libs", |
| 94 | ], |
| 95 | |
| 96 | srcs: [ |
| 97 | "Benchmark.cpp", |
Jeff Sharkey | 2048a28 | 2017-06-15 09:59:43 -0600 | [diff] [blame] | 98 | "CheckEncryption.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 99 | "Devmapper.cpp", |
| 100 | "EncryptInplace.cpp", |
| 101 | "Ext4Crypt.cpp", |
Jeff Sharkey | 2048a28 | 2017-06-15 09:59:43 -0600 | [diff] [blame] | 102 | "FileDeviceUtils.cpp", |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 103 | "IdleMaint.cpp", |
| 104 | "KeyBuffer.cpp", |
| 105 | "KeyStorage.cpp", |
| 106 | "KeyUtil.cpp", |
| 107 | "Keymaster.cpp", |
| 108 | "Loop.cpp", |
| 109 | "MetadataCrypt.cpp", |
| 110 | "MoveStorage.cpp", |
| 111 | "NetlinkHandler.cpp", |
| 112 | "NetlinkManager.cpp", |
| 113 | "Process.cpp", |
| 114 | "ScryptParameters.cpp", |
| 115 | "Utils.cpp", |
| 116 | "VoldNativeService.cpp", |
| 117 | "VoldUtil.cpp", |
| 118 | "VolumeManager.cpp", |
| 119 | "cryptfs.cpp", |
| 120 | "fs/Ext4.cpp", |
| 121 | "fs/F2fs.cpp", |
| 122 | "fs/Vfat.cpp", |
| 123 | "model/Disk.cpp", |
| 124 | "model/EmulatedVolume.cpp", |
| 125 | "model/ObbVolume.cpp", |
| 126 | "model/PrivateVolume.cpp", |
| 127 | "model/PublicVolume.cpp", |
| 128 | "model/VolumeBase.cpp", |
| 129 | "secontext.cpp", |
| 130 | ], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame^] | 131 | product_variables: { |
| 132 | arc: { |
| 133 | exclude_srcs: [ |
| 134 | "model/ObbVolume.cpp", |
| 135 | ], |
| 136 | static_libs: [ |
| 137 | "libarcobbvolume", |
| 138 | ], |
| 139 | }, |
| 140 | }, |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | cc_binary { |
| 144 | name: "vold", |
| 145 | defaults: [ |
| 146 | "vold_default_flags", |
| 147 | "vold_default_libs", |
| 148 | ], |
| 149 | |
| 150 | srcs: ["main.cpp"], |
| 151 | static_libs: ["libvold"], |
Risan | aedae61 | 2017-11-27 18:01:35 +0900 | [diff] [blame^] | 152 | product_variables: { |
| 153 | arc: { |
| 154 | static_libs: [ |
| 155 | "libarcobbvolume", |
| 156 | ] |
| 157 | }, |
| 158 | }, |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 159 | init_rc: ["vold.rc"], |
| 160 | |
| 161 | required: [ |
| 162 | "mke2fs", |
| 163 | "vold_prepare_subdirs", |
| 164 | ], |
| 165 | } |
| 166 | |
| 167 | cc_binary { |
| 168 | name: "vdc", |
| 169 | defaults: ["vold_default_flags"], |
| 170 | |
| 171 | srcs: ["vdc.cpp"], |
| 172 | shared_libs: [ |
| 173 | "libbase", |
| 174 | "libbinder", |
| 175 | "libcutils", |
| 176 | "libutils", |
| 177 | ], |
| 178 | static_libs: [ |
| 179 | "libvold_binder", |
| 180 | ], |
| 181 | init_rc: ["vdc.rc"], |
| 182 | } |
| 183 | |
| 184 | cc_binary { |
| 185 | name: "secdiscard", |
| 186 | defaults: ["vold_default_flags"], |
| 187 | |
| 188 | srcs: [ |
| 189 | "FileDeviceUtils.cpp", |
| 190 | "secdiscard.cpp", |
| 191 | ], |
| 192 | shared_libs: ["libbase"], |
| 193 | } |
| 194 | |
| 195 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 196 | name: "vold_prepare_subdirs", |
| 197 | defaults: ["vold_default_flags"], |
| 198 | |
Paul Crowley | 82b41ff | 2017-10-20 08:17:54 -0700 | [diff] [blame] | 199 | srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"], |
| 200 | shared_libs: [ |
| 201 | "libbase", |
| 202 | "libcutils", |
| 203 | "liblogwrap", |
| 204 | "libselinux", |
| 205 | "libutils", |
| 206 | ], |
| 207 | static_libs: [ |
| 208 | "libvold_binder", |
| 209 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 210 | } |
| 211 | |
| 212 | subdirs = ["tests"] |