Skip to content

Commit

Permalink
deps: V8 fix build on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
refack committed Nov 7, 2017
1 parent 5125034 commit 5366f80
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
12 changes: 6 additions & 6 deletions deps/v8/src/v8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -2554,23 +2554,23 @@
],
'action': [
'python',
'../tools/testrunner/utils/dump_build_config_gyp.py',
'<(PRODUCT_DIR)/v8_build_config.json',
'<@(_inputs)',
'<@(_outputs)',
'dcheck_always_on=<(dcheck_always_on)',
'is_asan=<(asan)',
'is_cfi=<(cfi_vptr)',
'is_component_build="<(component)"',
'is_debug="<(CONFIGURATION_NAME)"',
'is_component_build=<(component)',
'is_debug=<(CONFIGURATION_NAME)',
# Not available in gyp.
'is_gcov_coverage=0',
'is_msan=<(msan)',
'is_tsan=<(tsan)',
# Not available in gyp.
'is_ubsan_vptr=0',
'target_cpu="<(target_arch)"',
'target_cpu=<(target_arch)',
'v8_enable_i18n_support=<(v8_enable_i18n_support)',
'v8_enable_verify_predictable=<(v8_enable_verify_predictable)',
'v8_target_cpu="<(v8_target_arch)"',
'v8_target_cpu=<(v8_target_arch)',
'v8_use_snapshot=<(v8_use_snapshot)',
],
},
Expand Down
21 changes: 14 additions & 7 deletions deps/v8/tools/testrunner/utils/dump_build_config_gyp.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,35 @@

GYP_GN_CONVERSION = {
'is_component_build': {
'"shared_library"': 'true',
'"static_library"': 'false',
'shared_library': 'true',
'static_library': 'false',
},
'is_debug': {
'"Debug"': 'true',
'"Release"': 'false',
'Debug': 'true',
'Release': 'false',
},
}

DEFAULT_CONVERSION ={
'0': 'false',
'1': 'true',
'"ia32"': '"x86"',
'ia32': 'x86',
}

def gyp_to_gn(key, value):
return GYP_GN_CONVERSION.get(key, DEFAULT_CONVERSION).get(value, value)
value = GYP_GN_CONVERSION.get(key, DEFAULT_CONVERSION).get(value, value)
value = value if value in ['true', 'false'] else '"{0}"'.format(value)
return value

def as_json(kv):
assert '=' in kv
k, v = kv.split('=', 1)
return k, json.loads(gyp_to_gn(k, v))
v2 = gyp_to_gn(k, v)
try:
return k, json.loads(v2)
except ValueError as e:
print(k, v, v2)
raise e

with open(sys.argv[1], 'w') as f:
json.dump(dict(map(as_json, sys.argv[2:])), f)

0 comments on commit 5366f80

Please sign in to comment.