Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solidity: use modern cmake syntax #183889

Merged
merged 2 commits into from
Sep 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions Formula/s/solidity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,27 @@ class Solidity < Formula
end

depends_on "cmake" => :build
depends_on "fmt" => :build
depends_on "nlohmann-json" => :build
depends_on "range-v3" => :build
depends_on xcode: ["11.0", :build]
depends_on "boost"
depends_on "z3"
chenrui333 marked this conversation as resolved.
Show resolved Hide resolved

conflicts_with "solc-select", because: "both install `solc` binaries"

fails_with gcc: "5"

# build patch to use system fmt, nlohmann-json, and range-v3, upstream PR ref, https://github.com/ethereum/solidity/pull/15414
patch do
url "https://github.com/ethereum/solidity/commit/aa47181eef8fa63a6b4f52bff2c05517c66297a2.patch?full_index=1"
sha256 "b73e52a235087b184b8813a15a52c4b953046caa5200bf0aa60773ec4bb28300"
end

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

test do
Expand All @@ -45,6 +54,7 @@ def install
}
}
EOS

output = shell_output("#{bin}/solc --bin hello.sol")
assert_match "hello.sol:HelloWorld", output
assert_match "Binary:", output
Expand Down
Loading