From c8abd145963af5347d4c2bde698766ee75c8bec2 Mon Sep 17 00:00:00 2001 From: Joshua Clayton Date: Sun, 13 Jun 2021 08:30:21 -0400 Subject: [PATCH] Allow disabling mimalloc via flag What? ===== This adds a configuration option allowing users to not use mimalloc when compiling unused. --- Formula/unused.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Formula/unused.rb b/Formula/unused.rb index c0c66c9..4128566 100644 --- a/Formula/unused.rb +++ b/Formula/unused.rb @@ -8,8 +8,14 @@ class Unused < Formula depends_on "cmake" => :build depends_on "rust" => :build + option "without-mimalloc", "Use Rust's default allocator (may reduce performance)" + def install - system "cargo", "install", "--locked", "--root", prefix, "--path", "." + if build.with? "mimalloc" + system "cargo", "install", "--locked", "--root", prefix, "--path", ".", "--features", "mimalloc" + else + system "cargo", "install", "--locked", "--root", prefix, "--path", "." + end end test do