Merge pull request #2553 from rtfeldman/roc-link-flags

Read ROC_LINK_FLAGS env var to inject more link flags
This commit is contained in:
Richard Feldman 2022-02-22 00:07:32 -05:00 committed by GitHub
commit 91169a47f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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