Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: compile

Issue 29410617: Issue 5131 - [emscripten] Clean separation of bindings code and runtime code (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Left Patch Set: Call custom generators explicitly Created April 18, 2017, 9:05 a.m.
Right Patch Set: Rebased Created April 20, 2017, 1:49 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | compiled/bindings/generator.h » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 # This file is part of Adblock Plus <https://adblockplus.org/>, 3 # This file is part of Adblock Plus <https://adblockplus.org/>,
4 # Copyright (C) 2006-2017 Eyeo GmbH 4 # Copyright (C) 2006-2017 Eyeo GmbH
5 # 5 #
6 # Adblock Plus is free software: you can redistribute it and/or modify 6 # Adblock Plus is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License version 3 as 7 # it under the terms of the GNU General Public License version 3 as
8 # published by the Free Software Foundation. 8 # published by the Free Software Foundation.
9 # 9 #
10 # Adblock Plus is distributed in the hope that it will be useful, 10 # Adblock Plus is distributed in the hope that it will be useful,
(...skipping 23 matching lines...) Expand all
34 'ALLOW_MEMORY_GROWTH': 1, 34 'ALLOW_MEMORY_GROWTH': 1,
35 'NO_EXIT_RUNTIME': 1, 35 'NO_EXIT_RUNTIME': 1,
36 'NO_DYNAMIC_EXECUTION': 1, 36 'NO_DYNAMIC_EXECUTION': 1,
37 'NO_FILESYSTEM': 1, 37 'NO_FILESYSTEM': 1,
38 'INVOKE_RUN': 0, 38 'INVOKE_RUN': 0,
39 'TEXTDECODER': 0, 39 'TEXTDECODER': 0,
40 'EXPORTED_RUNTIME_METHODS': ['cwrap', 'ccall', 'stringToAscii'], 40 'EXPORTED_RUNTIME_METHODS': ['cwrap', 'ccall', 'stringToAscii'],
41 } 41 }
42 DEFINES = [] 42 DEFINES = []
43 ADDITIONAL_PARAMS = ['-O3', '-m32', '-std=gnu++14', '--memory-init-file', '0', 43 ADDITIONAL_PARAMS = ['-O3', '-m32', '-std=gnu++14', '--memory-init-file', '0',
44 '--emit-symbol-map', '-Wall', '-Werror', '-fno-exceptions'] 44 '--emit-symbol-map', '-Wall', '-Werror', '-fno-rtti']
45 45
46 46
47 def get_source_files(phase): 47 def get_source_files(phase):
48 for (path, dirs, files) in os.walk(SOURCE_DIR): 48 for (path, dirs, files) in os.walk(SOURCE_DIR):
49 for f in files: 49 for f in files:
50 if os.path.splitext(f)[1] != '.cpp': 50 if os.path.splitext(f)[1] != '.cpp':
51 continue 51 continue
52 if ( 52 if (
53 phase != 'bindings' and 53 phase != 'bindings' and
54 os.path.basename(path) == 'bindings' and 54 os.path.basename(path) == 'bindings' and
55 not f.startswith('runtime_') 55 not f.startswith('runtime_')
sergei 2017/04/18 10:46:09 I expected bindings/runtime_utils.cpp and files fo
Wladimir Palant 2017/04/18 11:01:37 I know. However, IMHO code locality is more import
56 ): 56 ):
57 continue 57 continue
58 yield os.path.join(path, f) 58 yield os.path.join(path, f)
59 59
60 def getenv(emscripten_config): 60 def getenv(emscripten_config):
61 scope = {} 61 scope = {}
62 execfile(emscripten_config, scope, scope) 62 execfile(emscripten_config, scope, scope)
63 env = os.environ.copy() 63 env = os.environ.copy()
64 env.update({ 64 env.update({
65 'EM_CONFIG': emscripten_config, 65 'EM_CONFIG': emscripten_config,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 parser.add_argument( 120 parser.add_argument(
121 '-t', '--tracing', 121 '-t', '--tracing',
122 action='store_true', 122 action='store_true',
123 help='Enable memory tracing' 123 help='Enable memory tracing'
124 ) 124 )
125 args = parser.parse_args() 125 args = parser.parse_args()
126 126
127 env = getenv(args.emscripten_config) 127 env = getenv(args.emscripten_config)
128 generate_bindings(env) 128 generate_bindings(env)
129 run_compiler(env, debug=args.debug, tracing=args.tracing) 129 run_compiler(env, debug=args.debug, tracing=args.tracing)
LEFTRIGHT

Powered by Google App Engine
This is Rietveld