Skip to content

Commit

Permalink
Merge pull request #178625 from Homebrew/lzfse-cmake
Browse files Browse the repository at this point in the history
lzfse: use modern cmake syntax
  • Loading branch information
chenrui333 committed Jul 27, 2024
2 parents 3bdca75 + bbede63 commit d73ebbc
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions Formula/l/lzfse.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,17 @@ class Lzfse < Formula
depends_on "cmake" => :build

def install
mkdir "build" do
system "cmake", "..", *std_cmake_args
system "make", "install"
end
system "cmake", "-S", ".", "-B", "build", *std_cmake_args
system "cmake", "--build", "build"
system "cmake", "--install", "build"
end

test do
File.binwrite("original", Random.new.bytes(0xFFFF))
(testpath/"original").write Random.new.bytes(0xFFFF)

system "#{bin}/lzfse", "-encode", "-i", "original", "-o", "encoded"
system "#{bin}/lzfse", "-decode", "-i", "encoded", "-o", "decoded"
system bin/"lzfse", "-encode", "-i", "original", "-o", "encoded"
system bin/"lzfse", "-decode", "-i", "encoded", "-o", "decoded"

assert compare_file("original", "decoded")
assert_equal (testpath/"original").read, (testpath/"decoded").read
end
end

0 comments on commit d73ebbc

Please sign in to comment.