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-BSD
21    default_applicable_licenses: ["external_googletest_license"],
22}
23
24cc_defaults {
25    name: "libgtest_defaults",
26    export_include_dirs: ["include"],
27    cflags: ["-Wall", "-Werror", "-Wno-unused-private-field"],
28}
29
30cc_defaults {
31    name: "libgtest_host_defaults",
32    target: {
33        linux_bionic: {
34            enabled: true,
35        },
36        windows: {
37            enabled: true,
38        },
39    },
40}
41
42// NDK libraries.
43// We need to build one pair of (libgtest, libgtest_main) for each of the three
44// STLs we support in the NDK since the user's app might use any of them.
45
46// libc++
47cc_library_static {
48    name: "libgtest_ndk_c++",
49    defaults: ["libgtest_defaults"],
50    sdk_version: "9",
51    stl: "c++_static",
52    srcs: ["src/gtest-all.cc"],
53}
54
55cc_library_static {
56    name: "libgtest_main_ndk_c++",
57    defaults: ["libgtest_defaults"],
58    sdk_version: "9",
59    stl: "c++_static",
60    srcs: ["src/gtest_main.cc"],
61}
62
63// Platform and host libraries.
64cc_library_static {
65    name: "libgtest",
66    defaults: ["libgtest_defaults", "libgtest_host_defaults"],
67    host_supported: true,
68    vendor_available: true,
69    product_available: true,
70    native_bridge_supported: true,
71    srcs: ["src/gtest-all.cc"],
72    rtti: true,
73}
74
75cc_library_static {
76    name: "libgtest_main",
77    defaults: ["libgtest_defaults", "libgtest_host_defaults"],
78    host_supported: true,
79    vendor_available: true,
80    product_available: true,
81    native_bridge_supported: true,
82    srcs: ["src/gtest_main.cc"],
83}
84
85// Legacy libraries for makefiles that refer to libgtest_host
86cc_library_host_static {
87    name: "libgtest_host",
88    whole_static_libs: ["libgtest"],
89    defaults: ["libgtest_host_defaults"],
90}
91
92cc_library_host_static {
93    name: "libgtest_main_host",
94    whole_static_libs: ["libgtest_main"],
95    defaults: ["libgtest_host_defaults"],
96}
97
98cc_library_headers {
99    name: "libgtest_prod_headers",
100    defaults: ["libgtest_defaults", "libgtest_host_defaults"],
101    host_supported: true,
102    native_bridge_supported: true,
103    recovery_available: true,
104    vendor_ramdisk_available: true,
105    vendor_available: true,
106    product_available: true,
107    export_include_dirs: ["include"],
108    apex_available: [
109        "//apex_available:anyapex",
110        "//apex_available:platform",
111    ],
112    min_sdk_version: "apex_inherit",
113}
114
115// Tests are in the Android.mk. Run with external/googletest/run_tests.py.
116