homebrew-core/Formula/aws-sdk-cpp.rb
2017-05-17 01:44:18 -07:00

47 lines
1.4 KiB
Ruby

class AwsSdkCpp < Formula
desc "AWS SDK for C++"
homepage "https://github.com/aws/aws-sdk-cpp"
url "https://github.com/aws/aws-sdk-cpp/archive/1.0.124.tar.gz"
sha256 "ff8421356b9fea5e2282cb2f0fe84dccf0574e717e4e7679fdbba1296745c644"
head "https://github.com/aws/aws-sdk-cpp.git"
bottle do
cellar :any
sha256 "fe87515a412e456fd39b43c268276ad429eefe5dda92e64d3d27d16b657098ad" => :sierra
sha256 "4d41eeb4e9b5a2a322dd9bba0b1b0cace5c981772ac570ffb426e2c918280a95" => :el_capitan
sha256 "3a82f5d01c98dbda4439291ef82750cdb314d12d4b9fa4ea88289d742e79ca48" => :yosemite
end
option "with-static", "Build with static linking"
option "without-http-client", "Don't include the libcurl HTTP client"
depends_on "cmake" => :build
def install
args = std_cmake_args
args << "-DSTATIC_LINKING=1" if build.with? "static"
args << "-DNO_HTTP_CLIENT=1" if build.without? "http-client"
mkdir "build" do
system "cmake", "..", *args
system "make"
system "make", "install"
end
lib.install Dir[lib/"mac/Release/*"].select { |f| File.file? f }
end
test do
(testpath/"test.cpp").write <<-EOS.undent
#include <aws/core/Version.h>
#include <iostream>
int main() {
std::cout << Aws::Version::GetVersionString() << std::endl;
return 0;
}
EOS
system ENV.cxx, "test.cpp", "-o", "test", "-laws-cpp-sdk-core"
system "./test"
end
end