1// Copyright (C) 2018 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 15cc_library_static { 16 name: "libgtest_isolated", 17 host_supported: true, 18 cflags: ["-Wall", "-Werror"], 19 export_include_dirs: ["include"], 20 21 srcs: [ 22 "Color.cpp", 23 "Isolate.cpp", 24 "IsolateMain.cpp", 25 "NanoTime.cpp", 26 "Options.cpp", 27 "Test.cpp", 28 ], 29 30 // NOTE: libbase is re-exported by including them below. 31 // When Soong supports transitive static dependency includes, this 32 // library can be removed. 33 whole_static_libs: [ 34 "libbase", 35 "libgtest", 36 ], 37 38 // Add liblog as a shared library so that gtests can override liblog 39 // functions without getting duplicate symbols. 40 shared_libs: [ 41 "liblog", 42 ], 43} 44 45cc_library_static { 46 name: "libgtest_isolated_main", 47 host_supported: true, 48 cflags: ["-Wall", "-Werror"], 49 srcs: [ 50 "Main.cpp", 51 ], 52 53 whole_static_libs: [ 54 "libgtest_isolated", 55 ], 56 57 // Add liblog as a shared library so that gtests can override liblog 58 // functions without getting duplicate symbols. 59 shared_libs: [ 60 "liblog", 61 ], 62} 63 64cc_test { 65 name: "gtest_isolated_tests", 66 host_supported: true, 67 srcs: [ 68 "tests/OptionsTest.cpp", 69 "tests/SystemTests.cpp", 70 ], 71 cflags: ["-Wall", "-Werror"], 72 73 shared_libs: [ 74 "libbase", 75 "liblog", 76 ], 77 static_libs: [ 78 "libgmock", 79 ], 80 whole_static_libs: ["libgtest_isolated_main"], 81 82 test_suites: ["device-tests"], 83} 84