homebrew-core/Formula/aws-sdk-cpp.rb
2016-09-23 05:43:39 -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.9.tar.gz"
sha256 "f9393d16b899cd4cc8bd70716b88cc0afeeec74726b7874ce2b8742ef6e03c8b"
head "https://github.com/aws/aws-sdk-cpp.git"
bottle do
cellar :any
sha256 "4cc6694295829b041570118dddee219ea8753a75770bbc7991878283018e227b" => :sierra
sha256 "17ee406ca2c7636abf99633cde6745b19fb84e215c8706976dc9cb87cff48e4a" => :el_capitan
sha256 "c4c00e8a24cd61aeb6a3f9e675babd63035144b8a74a20350259c1f167684459" => :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