OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import("//build/config/android/config.gni") | 5 import("//build/config/android/config.gni") |
6 import("//build/config/arm.gni") | 6 import("//build/config/arm.gni") |
7 import("//build/config/mips.gni") | 7 import("//build/config/mips.gni") |
8 import("//build/config/sanitizers/sanitizers.gni") | 8 import("//build/config/sanitizers/sanitizers.gni") |
9 | 9 |
10 if (is_android) { | 10 if (is_android) { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 # Similar to vfp but on MIPS. | 62 # Similar to vfp but on MIPS. |
63 v8_can_use_fpu_instructions = true | 63 v8_can_use_fpu_instructions = true |
64 | 64 |
65 # Similar to the ARM hard float ABI but on MIPS. | 65 # Similar to the ARM hard float ABI but on MIPS. |
66 v8_use_mips_abi_hardfloat = true | 66 v8_use_mips_abi_hardfloat = true |
67 } | 67 } |
68 | 68 |
69 v8_random_seed = "314159265" | 69 v8_random_seed = "314159265" |
70 v8_toolset_for_shell = "host" | 70 v8_toolset_for_shell = "host" |
71 | 71 |
72 if (v8_use_snapshot && v8_use_external_startup_data) { | |
73 snapshot_target = ":v8_external_snapshot" | |
74 } else if (v8_use_snapshot) { | |
75 snapshot_target = ":v8_snapshot" | |
76 } else { | |
77 assert(!v8_use_external_startup_data) | |
78 snapshot_target = ":v8_nosnapshot" | |
79 } | |
80 | |
81 ############################################################################### | 72 ############################################################################### |
82 # Configurations | 73 # Configurations |
83 # | 74 # |
84 config("internal_config") { | 75 config("internal_config") { |
85 visibility = [ ":*" ] # Only targets in this file can depend on this. | 76 visibility = [ ":*" ] # Only targets in this file can depend on this. |
86 | 77 |
87 include_dirs = [ "." ] | 78 include_dirs = [ "." ] |
88 | 79 |
89 if (is_component_build) { | 80 if (is_component_build) { |
90 defines = [ | 81 defines = [ |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 "--startup_blob", | 625 "--startup_blob", |
635 rebase_path("$root_out_dir/snapshot_blob.bin", root_build_dir), | 626 rebase_path("$root_out_dir/snapshot_blob.bin", root_build_dir), |
636 ] | 627 ] |
637 } | 628 } |
638 } | 629 } |
639 | 630 |
640 ############################################################################### | 631 ############################################################################### |
641 # Source Sets (aka static libraries) | 632 # Source Sets (aka static libraries) |
642 # | 633 # |
643 | 634 |
| 635 source_set("v8_maybe_snapshot") { |
| 636 if (v8_use_snapshot && v8_use_external_startup_data) { |
| 637 public_deps = [ ":v8_external_snapshot" ] |
| 638 } else if (v8_use_snapshot) { |
| 639 public_deps = [ ":v8_snapshot" ] |
| 640 } else { |
| 641 assert(!v8_use_external_startup_data) |
| 642 public_deps = [ ":v8_nosnapshot" ] |
| 643 } |
| 644 } |
| 645 |
644 v8_source_set("v8_nosnapshot") { | 646 v8_source_set("v8_nosnapshot") { |
645 visibility = [ ":*" ] # Only targets in this file can depend on this. | 647 visibility = [ ":*" ] # Only targets in this file can depend on this. |
646 | 648 |
647 deps = [ | 649 deps = [ |
648 ":js2c", | 650 ":js2c", |
649 ":js2c_experimental", | 651 ":js2c_experimental", |
650 ":js2c_experimental_extras", | 652 ":js2c_experimental_extras", |
651 ":js2c_extras", | 653 ":js2c_extras", |
652 ":v8_base", | 654 ":v8_base", |
653 ] | 655 ] |
(...skipping 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1993 visibility = [ ":*" ] # Only targets in this file can depend on this. | 1995 visibility = [ ":*" ] # Only targets in this file can depend on this. |
1994 | 1996 |
1995 sources = [ | 1997 sources = [ |
1996 "test/fuzzer/fuzzer-support.cc", | 1998 "test/fuzzer/fuzzer-support.cc", |
1997 "test/fuzzer/fuzzer-support.h", | 1999 "test/fuzzer/fuzzer-support.h", |
1998 ] | 2000 ] |
1999 | 2001 |
2000 configs = [ ":internal_config_base" ] | 2002 configs = [ ":internal_config_base" ] |
2001 | 2003 |
2002 deps = [ | 2004 deps = [ |
2003 snapshot_target, | 2005 ":v8_maybe_snapshot", |
2004 ] | 2006 ] |
2005 | 2007 |
2006 public_deps = [ | 2008 public_deps = [ |
2007 ":v8_libplatform", | 2009 ":v8_libplatform", |
2008 ] | 2010 ] |
2009 } | 2011 } |
2010 | 2012 |
2011 ############################################################################### | 2013 ############################################################################### |
2012 # Executables | 2014 # Executables |
2013 # | 2015 # |
(...skipping 21 matching lines...) Expand all Loading... |
2035 "//build/config/sanitizers:deps", | 2037 "//build/config/sanitizers:deps", |
2036 "//build/win:default_exe_manifest", | 2038 "//build/win:default_exe_manifest", |
2037 ] | 2039 ] |
2038 } | 2040 } |
2039 } | 2041 } |
2040 | 2042 |
2041 ############################################################################### | 2043 ############################################################################### |
2042 # Public targets | 2044 # Public targets |
2043 # | 2045 # |
2044 | 2046 |
| 2047 want_v8_shell = ( |
| 2048 (current_toolchain == host_toolchain && v8_toolset_for_shell == "host") || |
| 2049 (current_toolchain == v8_snapshot_toolchain && |
| 2050 v8_toolset_for_shell == "host") || |
| 2051 (current_toolchain != host_toolchain && v8_toolset_for_shell == "target")) |
| 2052 |
| 2053 group("gn_all") { |
| 2054 testonly = true |
| 2055 |
| 2056 deps = [ |
| 2057 ":d8", |
| 2058 ] |
| 2059 |
| 2060 if (want_v8_shell) { |
| 2061 deps += [ |
| 2062 ":v8_shell", |
| 2063 ] |
| 2064 } |
| 2065 |
| 2066 if (host_os != "mac" || !is_android) { |
| 2067 # These items don't compile for Android on Mac. |
| 2068 deps += [ |
| 2069 "test/unittests:unittests", |
| 2070 ] |
| 2071 } |
| 2072 } |
| 2073 |
2045 if (is_component_build) { | 2074 if (is_component_build) { |
2046 component("v8") { | 2075 component("v8") { |
2047 sources = [ | 2076 sources = [ |
2048 "src/v8dll-main.cc", | 2077 "src/v8dll-main.cc", |
2049 ] | 2078 ] |
2050 | 2079 |
2051 public_deps = [ | 2080 public_deps = [ |
2052 ":v8_base", | 2081 ":v8_base", |
2053 snapshot_target, | 2082 ":v8_maybe_snapshot", |
2054 ] | 2083 ] |
2055 | 2084 |
2056 configs -= [ "//build/config/compiler:chromium_code" ] | 2085 configs -= [ "//build/config/compiler:chromium_code" ] |
2057 configs += [ "//build/config/compiler:no_chromium_code" ] | 2086 configs += [ "//build/config/compiler:no_chromium_code" ] |
2058 configs += [ | 2087 configs += [ |
2059 ":internal_config", | 2088 ":internal_config", |
2060 ":features", | 2089 ":features", |
2061 ":toolchain", | 2090 ":toolchain", |
2062 ] | 2091 ] |
2063 | 2092 |
2064 public_configs = [ ":external_config" ] | 2093 public_configs = [ ":external_config" ] |
2065 } | 2094 } |
2066 } else { | 2095 } else { |
2067 group("v8") { | 2096 group("v8") { |
2068 public_deps = [ | 2097 public_deps = [ |
2069 ":v8_base", | 2098 ":v8_base", |
2070 snapshot_target, | 2099 ":v8_maybe_snapshot", |
2071 ] | 2100 ] |
2072 public_configs = [ ":external_config" ] | 2101 public_configs = [ ":external_config" ] |
2073 } | 2102 } |
2074 } | 2103 } |
2075 | 2104 |
2076 executable("d8") { | 2105 executable("d8") { |
2077 sources = [ | 2106 sources = [ |
2078 "src/d8.cc", | 2107 "src/d8.cc", |
2079 "src/d8.h", | 2108 "src/d8.h", |
2080 ] | 2109 ] |
(...skipping 26 matching lines...) Expand all Loading... |
2107 } | 2136 } |
2108 | 2137 |
2109 if (!is_component_build) { | 2138 if (!is_component_build) { |
2110 sources += [ "$target_gen_dir/d8-js.cc" ] | 2139 sources += [ "$target_gen_dir/d8-js.cc" ] |
2111 } | 2140 } |
2112 if (v8_enable_i18n_support) { | 2141 if (v8_enable_i18n_support) { |
2113 deps += [ "//third_party/icu" ] | 2142 deps += [ "//third_party/icu" ] |
2114 } | 2143 } |
2115 } | 2144 } |
2116 | 2145 |
2117 if ((current_toolchain == host_toolchain && v8_toolset_for_shell == "host") || | 2146 if (want_v8_shell) { |
2118 (current_toolchain == v8_snapshot_toolchain && | |
2119 v8_toolset_for_shell == "host") || | |
2120 (current_toolchain != host_toolchain && v8_toolset_for_shell == "target")) { | |
2121 executable("v8_shell") { | 2147 executable("v8_shell") { |
2122 sources = [ | 2148 sources = [ |
2123 "samples/shell.cc", | 2149 "samples/shell.cc", |
2124 ] | 2150 ] |
2125 | 2151 |
2126 configs -= [ "//build/config/compiler:chromium_code" ] | 2152 configs -= [ "//build/config/compiler:chromium_code" ] |
2127 configs += [ "//build/config/compiler:no_chromium_code" ] | 2153 configs += [ "//build/config/compiler:no_chromium_code" ] |
2128 configs += [ | 2154 configs += [ |
2129 # Note: don't use :internal_config here because this target will get | 2155 # Note: don't use :internal_config here because this target will get |
2130 # the :external_config applied to it by virtue of depending on :v8, and | 2156 # the :external_config applied to it by virtue of depending on :v8, and |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2199 sources = [ | 2225 sources = [ |
2200 "test/fuzzer/wasm-asmjs.cc", | 2226 "test/fuzzer/wasm-asmjs.cc", |
2201 ] | 2227 ] |
2202 | 2228 |
2203 deps = [ | 2229 deps = [ |
2204 ":fuzzer_support", | 2230 ":fuzzer_support", |
2205 ] | 2231 ] |
2206 | 2232 |
2207 configs = [ ":internal_config" ] | 2233 configs = [ ":internal_config" ] |
2208 } | 2234 } |
OLD | NEW |