-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rust: set MacOS env variables only on macOS
and get rid of SDKROOT, see #76780 (comment)
- Loading branch information
Showing
1 changed file
with
5 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,21 +61,16 @@ class Rust < Formula | |
def install | ||
ENV.prepend_path "PATH", Formula["[email protected]"].opt_libexec/"bin" | ||
|
||
# Fix build failure for compiler_builtins "error: invalid deployment target | ||
# for -stdlib=libc++ (requires OS X 10.7 or later)" | ||
ENV["MACOSX_DEPLOYMENT_TARGET"] = MacOS.version | ||
on_macos do | ||
# Fix build failure for compiler_builtins "error: invalid deployment target | ||
# for -stdlib=libc++ (requires OS X 10.7 or later)" | ||
ENV["MACOSX_DEPLOYMENT_TARGET"] = MacOS.version | ||
end | ||
|
||
# Ensure that the `openssl` crate picks up the intended library. | ||
# https://crates.io/crates/openssl#manual-configuration | ||
ENV["OPENSSL_DIR"] = Formula["[email protected]"].opt_prefix | ||
|
||
# Fix build failure for cmake v0.1.24 "error: internal compiler error: | ||
# src/librustc/ty/subst.rs:127: impossible case reached" on 10.11, and for | ||
# libgit2-sys-0.6.12 "fatal error: 'os/availability.h' file not found | ||
# #include <os/availability.h>" on 10.11 and "SecTrust.h:170:67: error: | ||
# expected ';' after top level declarator" among other errors on 10.12 | ||
ENV["SDKROOT"] = MacOS.sdk_path | ||
|
||
args = ["--prefix=#{prefix}"] | ||
if build.head? | ||
args << "--disable-rpath" | ||
|