homebrew-core/Formula/cpp-gsl.rb

27 lines
692 B
Ruby
Raw Normal View History

class CppGsl < Formula
desc "Microsoft's C++ Guidelines Support Library"
homepage "https://github.com/Microsoft/GSL"
url "https://github.com/Microsoft/GSL/archive/v2.0.0.tar.gz"
sha256 "6cce6fb16b651e62711a4f58e484931013c33979b795d1b1f7646f640cfa9c8e"
head "https://github.com/Microsoft/GSL.git"
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