From ad4821c67396acfa5f41b84a5ef67fcb1ec005dc Mon Sep 17 00:00:00 2001 From: Chen Hongji Date: Thu, 18 May 2017 02:27:27 -0400 Subject: [PATCH] antlr4-cpp-runtime 4.7 Closes #13738. Signed-off-by: FX Coudert --- Formula/antlr4-cpp-runtime.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Formula/antlr4-cpp-runtime.rb diff --git a/Formula/antlr4-cpp-runtime.rb b/Formula/antlr4-cpp-runtime.rb new file mode 100644 index 00000000000..41d4ddd1bf8 --- /dev/null +++ b/Formula/antlr4-cpp-runtime.rb @@ -0,0 +1,29 @@ +class Antlr4CppRuntime < Formula + desc "ANother Tool for Language Recognition C++ Runtime Library" + homepage "http://www.antlr.org" + url "http://www.antlr.org/download/antlr4-cpp-runtime-4.7-source.zip" + sha256 "3aa4bac23c60df14a687839b5e6aa7e94054112d3d3c5c8b1cffe270a4aeeaf7" + + depends_on "cmake" => :build + + def install + system "cmake", ".", *std_cmake_args + system "make", "install" + end + + test do + (testpath/"test.cc").write <<-EOS.undent + #include + int main(int argc, const char* argv[]) { + try { + throw antlr4::ParseCancellationException() ; + } catch (antlr4::ParseCancellationException &exception) { + /* ignore */ + } + return 0 ; + } + EOS + system ENV.cxx, "-std=c++11", "-I#{include}/antlr4-runtime", "test.cc", "-L#{lib}", "-lantlr4-runtime", "-o", "test" + system "./test" + end +end