From bbede63881a944e29af11598acb22603c40244fa Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Fri, 26 Jul 2024 17:57:13 -0400 Subject: [PATCH] lzfse: use modern cmake syntax Signed-off-by: Rui Chen --- Formula/l/lzfse.rb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/Formula/l/lzfse.rb b/Formula/l/lzfse.rb index 897607aa83c0b..22a487e3b865b 100644 --- a/Formula/l/lzfse.rb +++ b/Formula/l/lzfse.rb @@ -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