| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 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 from recipe_engine.config import BadConf | 5 from recipe_engine.config import BadConf |
| 6 from recipe_engine.config_types import Path | 6 from recipe_engine.config_types import Path |
| 7 from recipe_engine import config as recipe_config | 7 from recipe_engine import config as recipe_config |
| 8 | 8 |
| 9 import DEPS | 9 import DEPS |
| 10 CONFIG_CTX = DEPS['chromium'].CONFIG_CTX | 10 CONFIG_CTX = DEPS['chromium'].CONFIG_CTX |
| 11 | 11 |
| 12 | 12 |
| 13 @CONFIG_CTX() | 13 @CONFIG_CTX() |
| 14 def v8(c): | 14 def v8(c): |
| 15 targ_arch = c.gyp_env.GYP_DEFINES.get('target_arch') | 15 targ_arch = c.gyp_env.GYP_DEFINES.get('target_arch') |
| 16 if not targ_arch: # pragma: no cover | 16 if not targ_arch: # pragma: no cover |
| 17 raise recipe_config.BadConf('v8 must have a valid target_arch.') | 17 raise recipe_config.BadConf('v8 must have a valid target_arch.') |
| 18 c.gyp_env.GYP_DEFINES['v8_target_arch'] = targ_arch | 18 c.gyp_env.GYP_DEFINES['v8_target_arch'] = targ_arch |
| 19 if c.TARGET_PLATFORM == 'android': | 19 if c.TARGET_PLATFORM == 'android': |
| 20 c.gyp_env.GYP_DEFINES['OS'] = 'android' | 20 c.gyp_env.GYP_DEFINES['OS'] = 'android' |
| 21 del c.gyp_env.GYP_DEFINES['component'] | 21 del c.gyp_env.GYP_DEFINES['component'] |
| 22 c.build_dir = Path('[CHECKOUT]', 'out') | 22 c.build_dir = c.CHECKOUT_PATH.join('out') |
| 23 c.compile_py.build_tool = 'make' | 23 c.compile_py.build_tool = 'make' |
| 24 | 24 |
| 25 if c.HOST_PLATFORM == 'mac': | 25 if c.HOST_PLATFORM == 'mac': |
| 26 c.compile_py.build_tool = 'xcode' | 26 c.compile_py.build_tool = 'xcode' |
| 27 elif c.HOST_PLATFORM == 'win': | 27 elif c.HOST_PLATFORM == 'win': |
| 28 c.compile_py.build_tool = 'vs' | 28 c.compile_py.build_tool = 'vs' |
| 29 c.build_dir = Path('[CHECKOUT]', 'build') | 29 c.build_dir = c.CHECKOUT_PATH.join('build') |
| 30 | 30 |
| 31 if c.BUILD_CONFIG == 'Debug': | 31 if c.BUILD_CONFIG == 'Debug': |
| 32 c.gyp_env.GYP_DEFINES['v8_optimized_debug'] = 1 | 32 c.gyp_env.GYP_DEFINES['v8_optimized_debug'] = 1 |
| 33 c.gyp_env.GYP_DEFINES['v8_enable_slow_dchecks'] = 1 | 33 c.gyp_env.GYP_DEFINES['v8_enable_slow_dchecks'] = 1 |
| 34 | 34 |
| 35 # Chromium adds '_x64' to the output folder, which is only understood when | 35 # Chromium adds '_x64' to the output folder, which is only understood when |
| 36 # compiling v8 standalone with ninja. | 36 # compiling v8 standalone with ninja. |
| 37 if c.HOST_PLATFORM == 'win' and c.TARGET_BITS == 64: | 37 if c.HOST_PLATFORM == 'win' and c.TARGET_BITS == 64: |
| 38 c.build_config_fs = c.BUILD_CONFIG | 38 c.build_config_fs = c.BUILD_CONFIG |
| 39 c.compile_py.pass_arch_flag = True | 39 c.compile_py.pass_arch_flag = True |
| (...skipping 25 matching lines...) Expand all Loading... |
| 65 c.compile_py.default_targets = ['d8'] | 65 c.compile_py.default_targets = ['d8'] |
| 66 | 66 |
| 67 | 67 |
| 68 @CONFIG_CTX(includes=['v8']) | 68 @CONFIG_CTX(includes=['v8']) |
| 69 def disassembler(c): | 69 def disassembler(c): |
| 70 c.gyp_env.GYP_DEFINES['v8_enable_disassembler'] = 1 | 70 c.gyp_env.GYP_DEFINES['v8_enable_disassembler'] = 1 |
| 71 | 71 |
| 72 | 72 |
| 73 @CONFIG_CTX(includes=['v8']) | 73 @CONFIG_CTX(includes=['v8']) |
| 74 def embed_script_mjsunit(c): | 74 def embed_script_mjsunit(c): |
| 75 c.gyp_env.GYP_DEFINES['embed_script'] = Path( | 75 c.gyp_env.GYP_DEFINES['embed_script'] = c.CHECKOUT_PATH.join( |
| 76 '[CHECKOUT]', 'test', 'mjsunit', 'mjsunit.js') | 76 'test', 'mjsunit', 'mjsunit.js') |
| 77 | 77 |
| 78 | 78 |
| 79 @CONFIG_CTX(includes=['v8']) | 79 @CONFIG_CTX(includes=['v8']) |
| 80 def enable_slow_dchecks(c): | 80 def enable_slow_dchecks(c): |
| 81 c.gyp_env.GYP_DEFINES['v8_enable_slow_dchecks'] = 1 # pragma: no cover | 81 c.gyp_env.GYP_DEFINES['v8_enable_slow_dchecks'] = 1 # pragma: no cover |
| 82 | 82 |
| 83 | 83 |
| 84 @CONFIG_CTX(includes=['v8']) | 84 @CONFIG_CTX(includes=['v8']) |
| 85 def gcmole(c): | 85 def gcmole(c): |
| 86 c.gyp_env.GYP_DEFINES['gcmole'] = 1 | 86 c.gyp_env.GYP_DEFINES['gcmole'] = 1 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 101 c.gyp_env.GYP_DEFINES['v8_interpreted_regexp'] = 1 | 101 c.gyp_env.GYP_DEFINES['v8_interpreted_regexp'] = 1 |
| 102 | 102 |
| 103 | 103 |
| 104 @CONFIG_CTX(includes=['v8']) | 104 @CONFIG_CTX(includes=['v8']) |
| 105 def jsfunfuzz(c): | 105 def jsfunfuzz(c): |
| 106 c.gyp_env.GYP_DEFINES['jsfunfuzz'] = 1 | 106 c.gyp_env.GYP_DEFINES['jsfunfuzz'] = 1 |
| 107 | 107 |
| 108 | 108 |
| 109 @CONFIG_CTX(includes=['v8'], group='builder') | 109 @CONFIG_CTX(includes=['v8'], group='builder') |
| 110 def make(c): | 110 def make(c): |
| 111 c.build_dir = Path('[CHECKOUT]', 'out') | 111 c.build_dir = c.CHECKOUT_PATH.join('out') |
| 112 c.compile_py.build_tool = 'make' | 112 c.compile_py.build_tool = 'make' |
| 113 | 113 |
| 114 | 114 |
| 115 @CONFIG_CTX(includes=['ninja']) | 115 @CONFIG_CTX(includes=['ninja']) |
| 116 def v8_ninja(c): | 116 def v8_ninja(c): |
| 117 c.gyp_env.GYP_GENERATORS.add('ninja') | 117 c.gyp_env.GYP_GENERATORS.add('ninja') |
| 118 | 118 |
| 119 if c.HOST_PLATFORM == 'win' and c.TARGET_BITS == 64: | 119 if c.HOST_PLATFORM == 'win' and c.TARGET_BITS == 64: |
| 120 # Windows requires 64-bit builds to be in <dir>_x64 with ninja. See | 120 # Windows requires 64-bit builds to be in <dir>_x64 with ninja. See |
| 121 # crbug.com/470681. | 121 # crbug.com/470681. |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 def vtunejit(c): | 209 def vtunejit(c): |
| 210 c.gyp_env.GYP_DEFINES['v8_enable_vtunejit'] = 1 | 210 c.gyp_env.GYP_DEFINES['v8_enable_vtunejit'] = 1 |
| 211 | 211 |
| 212 | 212 |
| 213 @CONFIG_CTX(includes=['v8']) | 213 @CONFIG_CTX(includes=['v8']) |
| 214 def x87(c): | 214 def x87(c): |
| 215 # TODO(machenbach): Chromium does not support x87 yet. With the current | 215 # TODO(machenbach): Chromium does not support x87 yet. With the current |
| 216 # configuration, target_arch can't be set through a parameter as ARCH=intel | 216 # configuration, target_arch can't be set through a parameter as ARCH=intel |
| 217 # and BITS=32 is ambigue with x87. | 217 # and BITS=32 is ambigue with x87. |
| 218 c.gyp_env.GYP_DEFINES['v8_target_arch'] = 'x87' | 218 c.gyp_env.GYP_DEFINES['v8_target_arch'] = 'x87' |
| OLD | NEW |