1// Copyright (C) 2020 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15package { 16 // See: http://go/android-license-faq 17 // A large-scale-change added 'default_applicable_licenses' to import 18 // all of the 'license_kinds' from "system_security_license" 19 // to get the below license kinds: 20 // SPDX-license-identifier-Apache-2.0 21 default_applicable_licenses: ["system_security_license"], 22} 23 24// List of clang-tidy checks that are reported as errors. 25// Please keep this list ordered lexicographically. 26tidy_errors = [ 27 "cert-err34-c", 28 "google-default-arguments", 29 "google-runtime-int", 30 "google-runtime-member-string-references", 31 "misc-move-const-arg", 32 "misc-move-forwarding-reference", 33 "misc-unused-parameters", 34 "misc-unused-using-decls", 35 "misc-use-after-move", 36 "modernize-pass-by-value", 37 "performance-faster-string-find", 38 "performance-for-range-copy", 39 "performance-implicit-conversion-in-loop", 40 "performance-inefficient-vector-operation", 41 "performance-move-const-arg", 42 "performance-move-constructor-init", 43 "performance-noexcept-move-constructor", 44 "performance-unnecessary-value-param", 45] 46 47cc_defaults { 48 cpp_std: "experimental", 49 name: "odsign_flags_defaults", 50 cflags: [ 51 "-Wall", 52 "-Wextra", 53 "-Werror", 54 "-Wno-unused-parameter", 55 56 // Some extra flags. 57 "-fstrict-aliasing", 58 "-Wredundant-decls", 59 "-Wshadow", 60 "-Wstrict-aliasing", 61 "-Wthread-safety", 62 "-Wthread-safety-negative", 63 "-Wunreachable-code", 64 "-Wunreachable-code-break", 65 "-Wunreachable-code-return", 66 "-Wunused", 67 "-Wused-but-marked-unused", 68 ], 69 tidy: true, 70 tidy_checks: tidy_errors, 71 tidy_checks_as_errors: tidy_errors, 72 tidy_flags: [ 73 "-format-style=file", 74 ], 75} 76 77cc_library { 78 name: "libsigningutils", 79 defaults: [ 80 "odsign_flags_defaults", 81 ], 82 cpp_std: "experimental", 83 srcs: [ 84 "CertUtils.cpp", 85 "VerityUtils.cpp", 86 ], 87 88 static_libs: [ 89 "libc++fs", 90 ], 91 92 shared_libs: [ 93 "libbase", 94 "libcrypto", 95 "libcrypto_utils", 96 "libfsverity", 97 "libprotobuf-cpp-lite", 98 "libutils", 99 ], 100 export_include_dirs: ["include"], 101 recovery_available: true, 102} 103 104cc_binary { 105 name: "odsign", 106 defaults: [ 107 "odsign_flags_defaults", 108 ], 109 cpp_std: "experimental", 110 init_rc: ["odsign.rc"], 111 srcs: [ 112 "KeystoreKey.cpp", 113 "KeystoreHmacKey.cpp", 114 "odsign_main.cpp", 115 "StatsReporter.cpp", 116 ], 117 118 header_libs: ["odrefresh_headers"], 119 120 static_libs: [ 121 "libc++fs", 122 "libsigningutils", 123 "lib_odsign_proto", 124 ], 125 shared_libs: [ 126 "android.system.keystore2-V1-cpp", 127 "android.hardware.security.keymint-V1-cpp", 128 "libbase", 129 "libbinder", 130 "libcrypto", 131 "libcrypto_utils", 132 "libfsverity", 133 "liblogwrap", 134 "libprotobuf-cpp-lite", 135 "libutils", 136 ], 137} 138