File: BUILD.gn

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (90 lines) | stat: -rw-r--r-- 2,690 bytes parent folder | download | duplicates (19)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build_overrides/gtest.gni")
if (is_ios) {
  import("//build/buildflag_header.gni")
  import("//build/config/coverage/coverage.gni")
  import("//build/config/ios/ios_sdk.gni")
}

config("gtest_direct_config") {
  visibility = [ ":*" ]
  defines = [ "UNIT_TEST" ]
}

# The file/directory layout of Google Test is not yet considered stable. Until
# it stabilizes, Chromium code MUST use this target instead of reaching directly
# into //third_party/googletest.
static_library("gtest") {
  testonly = true

  sources = [
    "include/gtest/gtest-death-test.h",
    "include/gtest/gtest-message.h",
    "include/gtest/gtest-param-test.h",
    "include/gtest/gtest-spi.h",
    "include/gtest/gtest.h",
    "include/gtest/gtest_prod.h",

    # This is a workaround for the issues below.
    #
    # 1) This target needs to be a static_library (not a source set) on Mac to
    #    avoid the build errors in
    #    https://codereview.chromium.org/2779193002#msg82.
    # 2) A static_library must have at least one source file, to avoid build
    #    errors on Mac and Windows. https://crbug.com/710334
    # 3) A static_library with complete_static_lib = true, which would not
    #    require adding the empty file, will result in duplicate symbols on
    #    Android. https://codereview.chromium.org/2852613002/#ps20001
    "empty.cc",
  ]
  public_deps = [ "//third_party/googletest:gtest" ]

  public_configs = [ ":gtest_direct_config" ]

  if (gtest_include_multiprocess) {
    sources += [
      "../multiprocess_func_list.cc",
      "../multiprocess_func_list.h",
    ]
  }

  if (gtest_include_platform_test) {
    sources += [ "../platform_test.h" ]
  }

  if ((is_mac || is_ios) && gtest_include_objc_support) {
    sources += [
      "../gtest_mac.h",
      "../gtest_mac.mm",
    ]
    if (gtest_include_platform_test) {
      sources += [ "../platform_test_mac.mm" ]
    }
  }

  if (is_ios && gtest_include_ios_coverage) {
    sources += [
      "../coverage_util_ios.h",
      "../coverage_util_ios.mm",
    ]
    deps = [ ":ios_enable_coverage" ]
  }
}

# The file/directory layout of Google Test is not yet considered stable. Until
# it stabilizes, Chromium code MUST use this target instead of reaching directly
# into //third_party/googletest.
source_set("gtest_main") {
  testonly = true
  deps = [ "//third_party/googletest:gtest_main" ]
}

if (is_ios) {
  buildflag_header("ios_enable_coverage") {
    header = "ios_enable_coverage.h"
    flags = [ "IOS_ENABLE_COVERAGE=$use_clang_coverage" ]
  }
}