Skip to content

Commit

Permalink
json-c: use modern cmake syntax
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
chenrui333 committed Jul 26, 2024
1 parent c464905 commit d2e5de4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Formula/j/json-c.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d2e5de4

Please sign in to comment.