Skip to content

Commit b14c3b9

Browse files
committed
Use path for binaryen tools.
1 parent 01247d5 commit b14c3b9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

test/rollup_plugin/rollup.config.mjs

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ export default {
88
},
99
plugins: [
1010
emscriptenPlugin({
11-
'input': 'library.mjs'
11+
'input': 'library.mjs',
12+
'wasmMetaDCE': 'BINARYEN_PATH'
1213
})
1314
]
1415
};

test/test_other.py

+6
Original file line numberDiff line numberDiff line change
@@ -15871,7 +15871,13 @@ def get_exports(path):
1587115871
with webassembly.Module(path) as module:
1587215872
return [export.name for export in module.get_exports()]
1587315873

15874+
# Pass the path to wasm-metadce into the plugin.
1587415875
copytree(test_file('rollup_plugin'), '.')
15876+
rollup_config_file = 'rollup.config.mjs'
15877+
replacement_path = str(Path(building.get_binaryen_bin(), 'wasm-metadce'))
15878+
modified_content = read_file(rollup_config_file).replace("BINARYEN_PATH", replacement_path)
15879+
write_file(rollup_config_file, modified_content)
15880+
1587515881
self.run_process([EMCC, 'library.c', opt, '--no-entry', '-sMODULARIZE=instance', '-sENVIRONMENT=node', '--js-library', 'library.js', '-o', 'library.mjs'])
1587615882
self.run_process(['npm', 'install', path_from_root('tools/rollup-plugin-emscripten')])
1587715883
self.run_process(shared.get_npm_cmd('rollup') + ['--config'])

0 commit comments

Comments
 (0)