tools: pass custom template for js2c (#12593)
* Update node v9.7.0 ref * tools: pass custom template to node/tools/js2c.py
This commit is contained in:
parent
9e5c264012
commit
ad2baccefa
5 changed files with 31 additions and 31 deletions
|
@ -9,6 +9,19 @@ import sys
|
|||
|
||||
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
|
||||
|
||||
TEMPLATE = """
|
||||
#ifndef ATOM_NATIVES_H_
|
||||
#define ATOM_NATIVES_H_
|
||||
|
||||
namespace node {{
|
||||
|
||||
{definitions}
|
||||
|
||||
}} // namespace node
|
||||
|
||||
#endif // ATOM_NATIVES_H_
|
||||
"""
|
||||
|
||||
|
||||
def main():
|
||||
natives = os.path.abspath(sys.argv[1])
|
||||
|
@ -23,7 +36,8 @@ def call_js2c(natives, js_source_files):
|
|||
with scoped_cwd(src_dir):
|
||||
subprocess.check_call(
|
||||
[sys.executable, js2c, natives] +
|
||||
[os.path.basename(source) for source in js_source_files])
|
||||
[os.path.basename(source) for source in js_source_files] +
|
||||
['-t', TEMPLATE])
|
||||
|
||||
|
||||
@contextlib.contextmanager
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue