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