# 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 cctest.gyp. import("../../gni/v8.gni") gypi_values = exec_script("//build/gypi_to_gn.py", [ rebase_path("cctest.gyp") ], "scope", [ "cctest.gyp" ]) v8_executable("cctest") { testonly = true sources = [ "$target_gen_dir/resources.cc" ] + gypi_values.cctest_sources if (v8_current_cpu == "arm") { sources += gypi_values.cctest_sources_arm } else if (v8_current_cpu == "arm64") { sources += gypi_values.cctest_sources_arm64 } else if (v8_current_cpu == "x86") { sources += gypi_values.cctest_sources_ia32 } else if (v8_current_cpu == "mips") { sources += gypi_values.cctest_sources_mips } else if (v8_current_cpu == "mipsel") { sources += gypi_values.cctest_sources_mipsel } else if (v8_current_cpu == "mips64") { sources += gypi_values.cctest_sources_mips64 } else if (v8_current_cpu == "mips64el") { sources += gypi_values.cctest_sources_mips64el } else if (v8_current_cpu == "x64") { sources += gypi_values.cctest_sources_x64 } else if (v8_current_cpu == "x87") { sources += gypi_values.cctest_sources_x87 } else if (v8_current_cpu == "ppc" || v8_current_cpu == "ppc64") { sources += gypi_values.cctest_sources_ppc } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") { sources += gypi_values.cctest_sources_s390 } if (is_linux) { # TODO(machenbach): Translate 'or OS=="qnx"' from gyp. sources += [ "test-platform-linux.cc" ] } else if (is_win) { sources += [ "test-platform-win32.cc" ] } configs = [ "../..:external_config", "../..:internal_config_base", ] # TODO(machenbach): Translate from gyp. #["OS=="aix"", { # "ldflags": [ "-Wl,-bbigtoc" ], #}], deps = [ ":resources", "../..:v8_libplatform", "//build/config/sanitizers:deps", "//build/win:default_exe_manifest", ] if (is_component_build) { # cctest 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" ] } cflags = [] ldflags = [] if (v8_current_cpu == "ppc" || v8_current_cpu == "ppc64" || v8_current_cpu == "arm" || v8_current_cpu == "arm64" || v8_current_cpu == "s390" || v8_current_cpu == "s390x") { # Disable fmadd/fmsub so that expected results match generated code in # RunFloat64MulAndFloat64Add1 and friends. cflags += [ "-ffp-contract=off" ] } 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" ] # MSVS wants this for gay-{precision,shortest}.cc. cflags += [ "/bigobj" ] # Suppress warnings about importing locally defined symbols. if (is_component_build) { ldflags += [ "/ignore:4049", "/ignore:4217", ] } } } action("resources") { visibility = [ ":*" ] # Only targets in this file can depend on this. script = "../../tools/js2c.py" # The script depends on this other script, this rule causes a rebuild if it # changes. inputs = [ "../../tools/jsmin.py", ] # NOSORT sources = [ "../../tools/splaytree.js", "../../tools/codemap.js", "../../tools/csvparser.js", "../../tools/consarray.js", "../../tools/profile.js", "../../tools/profile_view.js", "../../tools/logreader.js", "log-eq-of-logging-and-traversal.js", ] outputs = [ "$target_gen_dir/resources.cc", ] args = [ rebase_path("$target_gen_dir/resources.cc", root_build_dir), "TEST", ] args += rebase_path(sources, root_build_dir) } v8_executable("generate-bytecode-expectations") { sources = [ "interpreter/bytecode-expectations-printer.cc", "interpreter/bytecode-expectations-printer.h", "interpreter/generate-bytecode-expectations.cc", ] configs = [ "../..:external_config", "../..:internal_config_base", ] deps = [ "../..:v8_libplatform", "//build/config/sanitizers:deps", "//build/win:default_exe_manifest", ] if (is_component_build) { # Same as cctest, we need to depend on the underlying static target. deps += [ "../..:v8_maybe_snapshot" ] } else { deps += [ "../..:v8" ] } if (is_win) { # Suppress warnings about importing locally defined symbols. if (is_component_build) { ldflags = [ "/ignore:4049", "/ignore:4217", ] } } }