Skip to content

Commit

Permalink
Allow disabling mimalloc via flag
Browse files Browse the repository at this point in the history
What?
=====

This adds a configuration option allowing users to not use mimalloc when
compiling unused.
  • Loading branch information
joshuaclayton committed Jun 13, 2021
1 parent c3325d0 commit c8abd14
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Formula/unused.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c8abd14

Please sign in to comment.