From 280334fe219d3037e6f7cdbd89f35c6c4f229ec9 Mon Sep 17 00:00:00 2001 From: Daniel Trebbien Date: Sat, 19 Sep 2015 13:24:54 -0400 Subject: [PATCH] rust: Add --with-llvm option --with-llvm allows Homebrew's LLVM to be used instead of Rust's LLVM. --- Library/Formula/rust.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Library/Formula/rust.rb b/Library/Formula/rust.rb index a4867ced9e78..56cef7db84ca 100644 --- a/Library/Formula/rust.rb +++ b/Library/Formula/rust.rb @@ -31,8 +31,11 @@ class Rust < Formula sha256 "04f68ef26b4ca636b35be1d17ad2b641727bbc10cec52582a9e3a64b5784dbeb" => :mavericks end + option "with-llvm", "Build with brewed LLVM. By default, Rust's LLVM will be used." + depends_on "cmake" => :build depends_on "pkg-config" => :build + depends_on "llvm" => :optional depends_on "openssl" # According to the official readme, GCC 4.7+ is required @@ -46,6 +49,7 @@ def install args = ["--prefix=#{prefix}"] args << "--disable-rpath" if build.head? args << "--enable-clang" if ENV.compiler == :clang + args << "--llvm-root=#{Formula["llvm"].opt_prefix}" if build.with? "llvm" if build.head? args << "--release-channel=nightly" else