From 494d81d605a9bc554942173f0a287bad923f7f57 Mon Sep 17 00:00:00 2001 From: adtennant Date: Fri, 18 Jan 2019 12:03:34 +0000 Subject: [PATCH] entityx 1.3.0 (new formula) Closes #36152. Signed-off-by: FX Coudert --- Formula/entityx.rb | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 Formula/entityx.rb diff --git a/Formula/entityx.rb b/Formula/entityx.rb new file mode 100644 index 0000000000..623f95552b --- /dev/null +++ b/Formula/entityx.rb @@ -0,0 +1,30 @@ +class Entityx < Formula + desc "Fast, type-safe C++ Entity Component System" + homepage "https://github.com/alecthomas/entityx" + url "https://github.com/alecthomas/entityx/archive/1.3.0.tar.gz" + sha256 "2cd56d4fc5c553b786b8caf0b5bd9231434f21d43ca0e963d3bc5ee503a06222" + + depends_on "cmake" => :build + + def install + system "cmake", ".", "-DENTITYX_BUILD_SHARED=off", "-DENTITYX_BUILD_TESTING=off", *std_cmake_args + system "make", "install" + end + + test do + (testpath/"test.cpp").write <<-EOS + #include + + int main(int argc, char *argv[]) { + entityx::EntityX ex; + + entityx::Entity entity = ex.entities.create(); + entity.destroy(); + + return 0; + } + EOS + system ENV.cxx, "test.cpp", "-std=c++11", "-L#{lib}", "-lentityx", "-o", "test" + system "./test" + end +end