homebrew-core/Formula/aws-sdk-cpp.rb
2016-12-16 01:56:41 -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.41.tar.gz"
sha256 "110f31dede646748d4ca3bfab9ffea49c48692063d1e16f404bb4751c3ace1e3"
head "https://github.com/aws/aws-sdk-cpp.git"
bottle do
cellar :any
sha256 "80027acc6e18c167c83322b3b097233535489e3a58a2aed4eed3deabdcc99fff" => :sierra
sha256 "7e596d87f9cc6d35e60232f907bf0d2d24cce258ca2fda60e74c41b005d9ae02" => :el_capitan
sha256 "24bd8485bd88ecb7324fa88ce4bbaf93293c0360a8409da2d9eb0b4225567668" => :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