Christopher Ferris | 1a99356 | 2018-08-21 12:43:50 -0700 | [diff] [blame] | 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 | |
Bob Badour | 192ca88 | 2021-02-12 15:34:19 -0800 | [diff] [blame] | 15 | package { |
| 16 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 17 | } |
| 18 | |
Christopher Ferris | aedc8f7 | 2019-07-17 15:45:29 -0700 | [diff] [blame] | 19 | cc_library_static { |
Christopher Ferris | 1a99356 | 2018-08-21 12:43:50 -0700 | [diff] [blame] | 20 | name: "libgtest_isolated", |
| 21 | host_supported: true, |
| 22 | cflags: ["-Wall", "-Werror"], |
| 23 | export_include_dirs: ["include"], |
| 24 | |
| 25 | srcs: [ |
| 26 | "Color.cpp", |
| 27 | "Isolate.cpp", |
| 28 | "IsolateMain.cpp", |
| 29 | "NanoTime.cpp", |
| 30 | "Options.cpp", |
| 31 | "Test.cpp", |
| 32 | ], |
| 33 | |
Christopher Ferris | cde0a07 | 2018-09-14 12:31:39 -0700 | [diff] [blame] | 34 | whole_static_libs: [ |
Christopher Ferris | cde0a07 | 2018-09-14 12:31:39 -0700 | [diff] [blame] | 35 | "libgtest", |
Christopher Ferris | aedc8f7 | 2019-07-17 15:45:29 -0700 | [diff] [blame] | 36 | ], |
| 37 | |
| 38 | // Add liblog as a shared library so that gtests can override liblog |
| 39 | // functions without getting duplicate symbols. |
| 40 | shared_libs: [ |
Christopher Ferris | cde0a07 | 2018-09-14 12:31:39 -0700 | [diff] [blame] | 41 | "liblog", |
| 42 | ], |
Christopher Ferris | 1a99356 | 2018-08-21 12:43:50 -0700 | [diff] [blame] | 43 | } |
| 44 | |
Christopher Ferris | aedc8f7 | 2019-07-17 15:45:29 -0700 | [diff] [blame] | 45 | cc_library_static { |
Christopher Ferris | 1a99356 | 2018-08-21 12:43:50 -0700 | [diff] [blame] | 46 | name: "libgtest_isolated_main", |
| 47 | host_supported: true, |
| 48 | cflags: ["-Wall", "-Werror"], |
| 49 | srcs: [ |
| 50 | "Main.cpp", |
| 51 | ], |
| 52 | |
Christopher Ferris | cde0a07 | 2018-09-14 12:31:39 -0700 | [diff] [blame] | 53 | whole_static_libs: [ |
| 54 | "libgtest_isolated", |
| 55 | ], |
Christopher Ferris | aedc8f7 | 2019-07-17 15:45:29 -0700 | [diff] [blame] | 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 | ], |
Christopher Ferris | 1a99356 | 2018-08-21 12:43:50 -0700 | [diff] [blame] | 62 | } |
| 63 | |
| 64 | cc_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 | |
Christopher Ferris | aedc8f7 | 2019-07-17 15:45:29 -0700 | [diff] [blame] | 73 | shared_libs: [ |
| 74 | "libbase", |
| 75 | "liblog", |
| 76 | ], |
Christopher Ferris | 2b6124f | 2019-09-19 23:06:41 -0700 | [diff] [blame] | 77 | static_libs: [ |
| 78 | "libgmock", |
| 79 | ], |
Christopher Ferris | 1a99356 | 2018-08-21 12:43:50 -0700 | [diff] [blame] | 80 | whole_static_libs: ["libgtest_isolated_main"], |
Christopher Ferris | 194dbad | 2019-09-03 13:52:44 -0700 | [diff] [blame] | 81 | |
| 82 | test_suites: ["device-tests"], |
Christopher Ferris | 1a99356 | 2018-08-21 12:43:50 -0700 | [diff] [blame] | 83 | } |