Skip to content

Commit

Permalink
Merge pull request #178614 from Homebrew/json-c-cmake
Browse files Browse the repository at this point in the history
json-c: use modern cmake syntax
  • Loading branch information
chenrui333 committed Jul 31, 2024
2 parents 3481d76 + 9d7b166 commit 077fd24
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 077fd24

Please sign in to comment.