1// Copyright (C) 2016 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 "external_googletest_license" 19 // to get the below license kinds: 20 // SPDX-license-identifier-Apache-2.0 21 // SPDX-license-identifier-BSD 22 default_applicable_licenses: ["external_googletest_license"], 23} 24 25cc_defaults { 26 name: "gmock_flags", 27 28 local_include_dirs: ["include"], 29 export_include_dirs: ["include"], 30 31 cflags: [ 32 "-Wall", 33 "-Werror", 34 "-Wno-missing-field-initializers", 35 "-Wno-sign-compare", 36 "-Wno-unused-parameter", 37 // We need to generate exception tables, otherwise any users of this 38 // library that use testing::Throw will trigger undefined behaviour. 39 "-fexceptions", 40 ], 41} 42 43cc_defaults { 44 name: "gmock_ndk", 45 sdk_version: "9", 46 stl: "c++_static", 47 cppflags: ["-std=c++11"], 48} 49 50cc_defaults { 51 name: "gmock_defaults", 52 host_supported: true, 53 target: { 54 linux_bionic: { 55 enabled: true, 56 }, 57 windows: { 58 enabled: true, 59 }, 60 }, 61} 62 63cc_library_static { 64 name: "libgmock_ndk", 65 defaults: [ 66 "gmock_ndk", 67 "gmock_flags", 68 ], 69 srcs: ["src/gmock-all.cc"], 70 static_libs: ["libgtest_ndk_c++"], 71} 72 73cc_library_static { 74 name: "libgmock_main_ndk", 75 defaults: [ 76 "gmock_ndk", 77 "gmock_flags", 78 ], 79 srcs: ["src/gmock_main.cc"], 80 static_libs: ["libgtest_ndk_c++"], 81} 82 83cc_library_static { 84 name: "libgmock", 85 defaults: [ 86 "gmock_defaults", 87 "gmock_flags", 88 ], 89 srcs: ["src/gmock-all.cc"], 90 rtti: true, 91 static_libs: ["libgtest"], 92 vendor_available: true, 93 product_available: true, 94 native_bridge_supported: true, 95} 96 97cc_library_static { 98 name: "libgmock_main", 99 defaults: [ 100 "gmock_defaults", 101 "gmock_flags", 102 ], 103 srcs: ["src/gmock_main.cc"], 104 static_libs: ["libgtest"], 105 vendor_available: true, 106 product_available: true, 107 native_bridge_supported: true, 108} 109 110// Deprecated: use libgmock instead 111cc_library_host_static { 112 name: "libgmock_host", 113 defaults: [ 114 "gmock_defaults", 115 "gmock_flags", 116 ], 117 whole_static_libs: ["libgmock"], 118} 119 120cc_library_host_static { 121 name: "libgmock_main_host", 122 defaults: [ 123 "gmock_defaults", 124 "gmock_flags", 125 ], 126 whole_static_libs: ["libgmock_main"], 127} 128