homebrew-core/Formula/aws-sdk-cpp.rb
2017-10-07 00:59:30 -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.2.10.tar.gz"
sha256 "d2981631e834f33a9e8400ea6f226596339ba094e2bc90c37184660495f76298"
head "https://github.com/aws/aws-sdk-cpp.git"
bottle do
cellar :any
sha256 "2dc78acdf712cd30148016391fd6dff35b9f320371fe7deb535cf0bab9af4848" => :high_sierra
sha256 "a5549abe172b9bac33be34df340b514c8c493e8d7ec0e55acb009ce46d0d24c4" => :sierra
sha256 "ae9add01a0432d63f1febcd9954181c6c5dd37b0a09d82d08401404d97f8b577" => :el_capitan
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", "-L#{lib}", "-laws-cpp-sdk-core"
system "./test"
end
end