mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
add env var to make the final wasm file be written
This commit is contained in:
parent
71d80a08d2
commit
f1d238cccf
5 changed files with 37 additions and 2 deletions
|
@ -34,6 +34,16 @@ fn promote_expr_to_module(src: &str) -> String {
|
|||
buffer
|
||||
}
|
||||
|
||||
fn write_final_wasm() -> bool {
|
||||
use roc_debug_flags::{dbg_do, ROC_WRITE_FINAL_WASM};
|
||||
|
||||
dbg_do!(ROC_WRITE_FINAL_WASM, {
|
||||
return true;
|
||||
});
|
||||
|
||||
DEBUG_SETTINGS.keep_test_binary
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
pub fn compile_to_wasm_bytes<'a, T: Wasm32Result>(
|
||||
arena: &'a bumpalo::Bump,
|
||||
|
@ -46,7 +56,7 @@ pub fn compile_to_wasm_bytes<'a, T: Wasm32Result>(
|
|||
let compiled_bytes =
|
||||
compile_roc_to_wasm_bytes(arena, platform_bytes, src, test_wrapper_type_info);
|
||||
|
||||
if DEBUG_SETTINGS.keep_test_binary {
|
||||
if write_final_wasm() {
|
||||
let build_dir_hash = crate::helpers::src_hash(src);
|
||||
crate::helpers::save_wasm_file(&compiled_bytes, build_dir_hash)
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue