OLD | NEW |
(Empty) | |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. |
| 4 |
| 5 import("//build_overrides/gtest.gni") |
| 6 |
| 7 config("gtest_direct_config") { |
| 8 visibility = [ ":*" ] |
| 9 defines = [ "UNIT_TEST" ] |
| 10 } |
| 11 |
| 12 # The file/directory layout of Google Test is not yet considered stable. Until |
| 13 # it stabilizes, Chromium code MUST use this target instead of reaching directly |
| 14 # into //third_party/googletest. |
| 15 static_library("gtest") { |
| 16 testonly = true |
| 17 |
| 18 sources = [ |
| 19 "include/gtest/gtest-death-test.h", |
| 20 "include/gtest/gtest-message.h", |
| 21 "include/gtest/gtest-param-test.h", |
| 22 "include/gtest/gtest-spi.h", |
| 23 "include/gtest/gtest.h", |
| 24 "include/gtest/gtest_prod.h", |
| 25 |
| 26 # This is a workaround for the issues below. |
| 27 # |
| 28 # 1) This target needs to be a static_library (not a source set) on Mac to |
| 29 # avoid the build errors in |
| 30 # https://codereview.chromium.org/2779193002#msg82. |
| 31 # 2) A static_library must have at least one source file, to avoid build |
| 32 # errors on Mac and Windows. https://crbug.com/710334 |
| 33 # 3) A static_library with complete_static_lib = true, which would not |
| 34 # require adding the empty file, will result in duplicate symbols on |
| 35 # Android. https://codereview.chromium.org/2852613002/#ps20001 |
| 36 "empty.cc", |
| 37 ] |
| 38 deps = [ |
| 39 "//third_party/googletest:gtest", |
| 40 ] |
| 41 |
| 42 public_configs = [ ":gtest_direct_config" ] |
| 43 |
| 44 if (gtest_include_multiprocess) { |
| 45 sources += [ |
| 46 "../multiprocess_func_list.cc", |
| 47 "../multiprocess_func_list.h", |
| 48 ] |
| 49 } |
| 50 |
| 51 if (gtest_include_platform_test) { |
| 52 sources += [ "../platform_test.h" ] |
| 53 } |
| 54 |
| 55 if ((is_mac || is_ios) && gtest_include_objc_support) { |
| 56 if (is_ios) { |
| 57 set_sources_assignment_filter([]) |
| 58 } |
| 59 sources += [ |
| 60 "../gtest_mac.h", |
| 61 "../gtest_mac.mm", |
| 62 ] |
| 63 if (gtest_include_platform_test) { |
| 64 sources += [ "../platform_test_mac.mm" ] |
| 65 } |
| 66 set_sources_assignment_filter(sources_assignment_filter) |
| 67 } |
| 68 |
| 69 if (is_ios && gtest_include_ios_coverage) { |
| 70 sources += [ |
| 71 "../coverage_util_ios.cc", |
| 72 "../coverage_util_ios.h", |
| 73 ] |
| 74 } |
| 75 } |
| 76 |
| 77 # The file/directory layout of Google Test is not yet considered stable. Until |
| 78 # it stabilizes, Chromium code MUST use this target instead of reaching directly |
| 79 # into //third_party/googletest. |
| 80 source_set("gtest_main") { |
| 81 testonly = true |
| 82 deps = [ |
| 83 "//third_party/googletest:gtest_main", |
| 84 ] |
| 85 } |
OLD | NEW |