From d2e5de4c2f7272abcd442a738c9efab2ff38e671 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Fri, 26 Jul 2024 17:22:23 -0400 Subject: [PATCH] json-c: use modern cmake syntax Signed-off-by: Rui Chen --- Formula/j/json-c.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Formula/j/json-c.rb b/Formula/j/json-c.rb index 7834898dcea841..eadfaee695874f 100644 --- a/Formula/j/json-c.rb +++ b/Formula/j/json-c.rb @@ -27,10 +27,9 @@ class JsonC < 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 @@ -46,6 +45,7 @@ def install return 0; } EOS + system ENV.cc, "-I#{include}", "test.c", "-L#{lib}", "-ljson-c", "-o", "test" assert_equal '{ "key": "value" }', shell_output("./test").chomp end