homebrew-core/Formula/aws-sdk-cpp.rb
2016-11-12 02:56:45 -08: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.25.tar.gz"
sha256 "f0e4f95b9a01a66463e3e6df17a05341e608dc6d44654605a17d57577e2b1e1e"
head "https://github.com/aws/aws-sdk-cpp.git"
bottle do
cellar :any
sha256 "7e80c1d2e5429ce65cf1c8dddca570de288195f5f233f0fb2df7ef306c51bf29" => :sierra
sha256 "15e450ca06f9d9f3ee9d6f34a8a9a220f6ba6068250bc4347865af18e69612cb" => :el_capitan
sha256 "cefb752fc983465724081958680797c930dc81836e33802b553e7a31677ad938" => :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