2016-06-01 12:28:57 +00:00
|
|
|
# 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.
|
|
|
|
|
2016-06-28 13:22:46 +00:00
|
|
|
# The sources are kept automatically in sync with unittests.gyp.
|
2016-06-01 12:28:57 +00:00
|
|
|
|
|
|
|
import("../../gni/v8.gni")
|
|
|
|
|
2016-06-28 13:22:46 +00:00
|
|
|
gypi_values = exec_script("//build/gypi_to_gn.py",
|
|
|
|
[ rebase_path("unittests.gyp") ],
|
|
|
|
"scope",
|
|
|
|
[ "unittests.gyp" ])
|
|
|
|
|
2016-06-14 10:07:22 +00:00
|
|
|
v8_executable("unittests") {
|
2016-06-01 12:28:57 +00:00
|
|
|
testonly = true
|
|
|
|
|
2016-06-28 13:22:46 +00:00
|
|
|
sources = gypi_values.unittests_sources
|
2016-06-01 12:28:57 +00:00
|
|
|
|
2016-07-15 22:32:55 +00:00
|
|
|
if (v8_current_cpu == "arm") {
|
2016-06-28 13:22:46 +00:00
|
|
|
sources += gypi_values.unittests_sources_arm
|
2016-07-15 22:32:55 +00:00
|
|
|
} else if (v8_current_cpu == "arm64") {
|
2016-06-28 13:22:46 +00:00
|
|
|
sources += gypi_values.unittests_sources_arm64
|
2016-07-15 22:32:55 +00:00
|
|
|
} else if (v8_current_cpu == "x86") {
|
2016-06-28 13:22:46 +00:00
|
|
|
sources += gypi_values.unittests_sources_ia32
|
2016-07-15 22:32:55 +00:00
|
|
|
} else if (v8_current_cpu == "mips" || v8_current_cpu == "mipsel") {
|
2016-06-28 13:22:46 +00:00
|
|
|
sources += gypi_values.unittests_sources_mips
|
2016-07-15 22:32:55 +00:00
|
|
|
} else if (v8_current_cpu == "mips64" || v8_current_cpu == "mips64el") {
|
2016-06-28 13:22:46 +00:00
|
|
|
sources += gypi_values.unittests_sources_mips64
|
2016-07-15 22:32:55 +00:00
|
|
|
} else if (v8_current_cpu == "x64") {
|
2016-06-28 13:22:46 +00:00
|
|
|
sources += gypi_values.unittests_sources_x64
|
2016-07-15 22:32:55 +00:00
|
|
|
} else if (v8_current_cpu == "ppc" || v8_current_cpu == "ppc64") {
|
2016-06-28 13:22:46 +00:00
|
|
|
sources += gypi_values.unittests_sources_ppc
|
2016-07-15 22:32:55 +00:00
|
|
|
} else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") {
|
2016-06-28 13:22:46 +00:00
|
|
|
sources += gypi_values.unittests_sources_s390
|
2016-06-01 12:28:57 +00:00
|
|
|
}
|
|
|
|
|
2016-06-14 10:07:22 +00:00
|
|
|
configs = [
|
2016-06-01 12:28:57 +00:00
|
|
|
"../..: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" ]
|
|
|
|
}
|
2016-06-03 08:21:11 +00:00
|
|
|
|
|
|
|
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) {
|
2016-06-13 04:23:37 +00:00
|
|
|
ldflags = [
|
|
|
|
"/ignore:4049",
|
|
|
|
"/ignore:4217",
|
|
|
|
]
|
2016-06-03 08:21:11 +00:00
|
|
|
}
|
|
|
|
}
|
2016-06-01 12:28:57 +00:00
|
|
|
}
|