ignore if set_shared_buffer is not defined

This commit is contained in:
Folkert 2022-07-27 23:50:06 +02:00
parent e62a0ee39a
commit fc01a0ee44
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -22,15 +22,17 @@ pub fn add_default_roc_externs(env: &Env<'_, '_, '_>) {
match env.mode { match env.mode {
super::build::LlvmBackendMode::CliTest => { super::build::LlvmBackendMode::CliTest => {
// expose this function // expose this function
let fn_val = module.get_function("set_shared_buffer").unwrap(); if let Some(fn_val) = module.get_function("set_shared_buffer") {
fn_val.set_linkage(Linkage::External); fn_val.set_linkage(Linkage::External);
} }
}
_ => { _ => {
// remove this function from the module // remove this function from the module
let fn_val = module.get_function("set_shared_buffer").unwrap(); if let Some(fn_val) = module.get_function("set_shared_buffer") {
unsafe { fn_val.delete() }; unsafe { fn_val.delete() };
} }
} }
}
if !env.mode.has_host() { if !env.mode.has_host() {
// roc_alloc // roc_alloc