antlr4-cpp-runtime 4.7

Closes #13738.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
Chen Hongji 2017-05-18 02:27:27 -04:00 committed by FX Coudert
parent 9e58b9e2ea
commit ad4821c673

View file

@ -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 <antlr4-runtime.h>
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