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