14 wasm_intrinsics_wat = args[0]
15 wasm_intrinsics_cpp_in = args[1]
16 wasm_intrinsics_cpp_out = args[2]
17 with open(wasm_intrinsics_wat,
'rb')
as fd:
19 wat_hex =
','.
join([hex(byte)
for byte
in wat])
20 with open(wasm_intrinsics_cpp_in)
as fd:
22 template = template.replace(
'@WASM_INTRINSICS_SIZE@',
'%s' %
len(wat))
23 template = template.replace(
'@WASM_INTRINSICS_EMBED@', wat_hex)
24 with open(wasm_intrinsics_cpp_out,
'w')
as fd:
31 with open(cmake_in)
as fd:
33 with open(config_h_in)
as fd:
36 r'project\(binaryen LANGUAGES C CXX VERSION (?P<version>[0-9]+)\)',
38 version = match[
'version']
39 git_args = [
'git',
'rev-parse',
'HEAD']
41 output = subprocess.check_output(git_args,
42 cwd=os.path.dirname(cmake_in),
44 version =
'%s (%s)' % (version, output.strip())
47 template = template.replace(
'#cmakedefine',
'#define')
48 template = template.replace(
'${PROJECT_VERSION}', version)
49 with open(config_out,
'w')
as fd:
53if __name__ ==
'__main__':
static SkString join(const CommandLineFlags::StringArray &)