diff --git a/compiler/build/src/link.rs b/compiler/build/src/link.rs index b3d5e52062..eab0872161 100644 --- a/compiler/build/src/link.rs +++ b/compiler/build/src/link.rs @@ -850,6 +850,18 @@ fn link_macos( ld_command.arg(format!("-L{}/swift", sdk_path)); }; + let roc_link_flags = match env::var("ROC_LINK_FLAGS") { + Ok(flags) => { + println!("⚠️ CAUTION: The ROC_LINK_FLAGS environment variable is a temporary workaround, and will no longer do anything once surgical linking lands! If you're concerned about what this means for your use case, please ask about it on Zulip."); + + flags + } + Err(_) => "".to_string(), + }; + for roc_link_flag in roc_link_flags.split_whitespace() { + ld_command.arg(roc_link_flag.to_string()); + } + ld_command.args(&[ // Libraries - see https://github.com/rtfeldman/roc/pull/554#discussion_r496392274 // for discussion and further references