aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/test/unittests/BUILD.gn
blob: 7193afb9668b1c2caaee6e4ba76ea7c8f1199f0a (plain)
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
# Copyright 2016 The V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# The sources are kept automatically in sync with unittests.gyp.

import("../../gni/v8.gni")

gypi_values = exec_script("//build/gypi_to_gn.py",
                          [ rebase_path("unittests.gyp") ],
                          "scope",
                          [ "unittests.gyp" ])

v8_executable("unittests") {
  testonly = true

  sources = gypi_values.unittests_sources

  if (v8_current_cpu == "arm") {
    sources += gypi_values.unittests_sources_arm
  } else if (v8_current_cpu == "arm64") {
    sources += gypi_values.unittests_sources_arm64
  } else if (v8_current_cpu == "x86") {
    sources += gypi_values.unittests_sources_ia32
  } else if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel") {
    sources += gypi_values.unittests_sources_mips
  } else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
    sources += gypi_values.unittests_sources_mips64
  } else if (v8_current_cpu == "x64") {
    sources += gypi_values.unittests_sources_x64
  } else if (v8_current_cpu == "ppc" || v8_current_cpu == "ppc64") {
    sources += gypi_values.unittests_sources_ppc
  } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
    sources += gypi_values.unittests_sources_s390
  }

  configs = [
    "../..:external_config",
    "../..:internal_config_base",
  ]

  # TODO(machenbach): Translate from gyp.
  #['OS=="aix"', {
  #  'ldflags': [ '-Wl,-bbigtoc' ],
  #}],

  deps = [
    "../..:v8_libplatform",
    "//build/config/sanitizers:deps",
    "//build/win:default_exe_manifest",
    "//testing/gmock",
    "//testing/gtest",
  ]

  if (is_component_build) {
    # compiler-unittests can't be built against a shared library, so we
    # need to depend on the underlying static target in that case.
    deps += [ "../..:v8_maybe_snapshot" ]
  } else {
    deps += [ "../..:v8" ]
  }

  if (is_win) {
    # This warning is benignly triggered by the U16 and U32 macros in
    # bytecode-utils.h.
    # C4309: 'static_cast': truncation of constant value
    cflags = [ "/wd4309" ]

    # Suppress warnings about importing locally defined symbols.
    if (is_component_build) {
      ldflags = [
        "/ignore:4049",
        "/ignore:4217",
      ]
    }
  }
}