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", |
| 94 | "Devmapper.cpp", |
| 95 | "EncryptInplace.cpp", |
| 96 | "Ext4Crypt.cpp", |
| 97 | "IdleMaint.cpp", |
| 98 | "KeyBuffer.cpp", |
| 99 | "KeyStorage.cpp", |
| 100 | "KeyUtil.cpp", |
| 101 | "Keymaster.cpp", |
| 102 | "Loop.cpp", |
| 103 | "MetadataCrypt.cpp", |
| 104 | "MoveStorage.cpp", |
| 105 | "NetlinkHandler.cpp", |
| 106 | "NetlinkManager.cpp", |
| 107 | "Process.cpp", |
| 108 | "ScryptParameters.cpp", |
| 109 | "Utils.cpp", |
| 110 | "VoldNativeService.cpp", |
| 111 | "VoldUtil.cpp", |
| 112 | "VolumeManager.cpp", |
| 113 | "cryptfs.cpp", |
| 114 | "fs/Ext4.cpp", |
| 115 | "fs/F2fs.cpp", |
| 116 | "fs/Vfat.cpp", |
| 117 | "model/Disk.cpp", |
| 118 | "model/EmulatedVolume.cpp", |
| 119 | "model/ObbVolume.cpp", |
| 120 | "model/PrivateVolume.cpp", |
| 121 | "model/PublicVolume.cpp", |
| 122 | "model/VolumeBase.cpp", |
| 123 | "secontext.cpp", |
| 124 | ], |
| 125 | } |
| 126 | |
| 127 | cc_binary { |
| 128 | name: "vold", |
| 129 | defaults: [ |
| 130 | "vold_default_flags", |
| 131 | "vold_default_libs", |
| 132 | ], |
| 133 | |
| 134 | srcs: ["main.cpp"], |
| 135 | static_libs: ["libvold"], |
| 136 | init_rc: ["vold.rc"], |
| 137 | |
| 138 | required: [ |
| 139 | "mke2fs", |
| 140 | "vold_prepare_subdirs", |
| 141 | ], |
| 142 | } |
| 143 | |
| 144 | cc_binary { |
| 145 | name: "vdc", |
| 146 | defaults: ["vold_default_flags"], |
| 147 | |
| 148 | srcs: ["vdc.cpp"], |
| 149 | shared_libs: [ |
| 150 | "libbase", |
| 151 | "libbinder", |
| 152 | "libcutils", |
| 153 | "libutils", |
| 154 | ], |
| 155 | static_libs: [ |
| 156 | "libvold_binder", |
| 157 | ], |
| 158 | init_rc: ["vdc.rc"], |
| 159 | } |
| 160 | |
| 161 | cc_binary { |
| 162 | name: "secdiscard", |
| 163 | defaults: ["vold_default_flags"], |
| 164 | |
| 165 | srcs: [ |
| 166 | "FileDeviceUtils.cpp", |
| 167 | "secdiscard.cpp", |
| 168 | ], |
| 169 | shared_libs: ["libbase"], |
| 170 | } |
| 171 | |
| 172 | cc_binary { |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 173 | name: "vold_prepare_subdirs", |
| 174 | defaults: ["vold_default_flags"], |
| 175 | |
Paul Crowley | 82b41ff | 2017-10-20 08:17:54 -0700 | [diff] [blame^] | 176 | srcs: ["vold_prepare_subdirs.cpp", "Utils.cpp"], |
| 177 | shared_libs: [ |
| 178 | "libbase", |
| 179 | "libcutils", |
| 180 | "liblogwrap", |
| 181 | "libselinux", |
| 182 | "libutils", |
| 183 | ], |
| 184 | static_libs: [ |
| 185 | "libvold_binder", |
| 186 | ], |
Jeff Sharkey | d16dc50 | 2017-10-23 14:38:55 -0600 | [diff] [blame] | 187 | } |
| 188 | |
| 189 | subdirs = ["tests"] |