homebrew-core/Formula/cpp-gsl.rb

32 lines
856 B
Ruby

class CppGsl < Formula
desc "Microsoft's C++ Guidelines Support Library"
homepage "https://github.com/Microsoft/GSL"
url "https://github.com/Microsoft/GSL/archive/v4.0.0.tar.gz"
sha256 "95a51cd6432b491a71cac92ed279fd07668d1594d8909ea5654fb98156d57a10"
license "MIT"
head "https://github.com/Microsoft/GSL.git", branch: "main"
bottle do
sha256 cellar: :any_skip_relocation, all: "16ded5e62ddff466d23c8de41624941b2d72d663a8225e311ac12d24674afc11"
end
depends_on "cmake" => :build
def install
system "cmake", ".", "-DGSL_TEST=false", *std_cmake_args
system "make", "install"
end
test do
(testpath/"test.cpp").write <<~EOS
#include <gsl/gsl>
int main() {
gsl::span<int> z;
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-o", "test", "-std=c++14"
system "./test"
end
end