class AzureStorageCpp < Formula desc "Microsoft Azure Storage Client Library for C++" homepage "https://azure.github.io/azure-storage-cpp" url "https://github.com/Azure/azure-storage-cpp/archive/v6.0.0.tar.gz" sha256 "3ec43349b741e0d8619e5510901a0abe8832da83167c74275b2e79544d105956" bottle do cellar :any sha256 "6929f7ab7ccc75d3986b804d8bbd39e16ced42c16d2923ff6d92dabf5836e905" => :mojave sha256 "32a47cb8d26d52a582163dc7b05af696b279ee63b7557209b53e81e15e37a9ad" => :high_sierra sha256 "c65aa60f0f007fb849a5bb31a7c4e46a0d1c8c5113fb950968798defdb78e2df" => :sierra end depends_on "cmake" => :build depends_on "boost" depends_on "cpprestsdk" depends_on "gettext" depends_on "openssl" depends_on "ossp-uuid" def install system "cmake", "Microsoft.WindowsAzure.Storage", "-DBUILD_SAMPLES=OFF", "-DBUILD_TESTS=OFF", *std_cmake_args system "make", "install" end test do (testpath/"test.cpp").write <<~EOS #include #include using namespace azure; int main() { utility::string_t storage_connection_string(_XPLATSTR("DefaultEndpointsProtocol=https;AccountName=myaccountname;AccountKey=myaccountkey")); try { azure::storage::cloud_storage_account storage_account = azure::storage::cloud_storage_account::parse(storage_connection_string); return 0; } catch(...){ return 1; } } EOS flags = ["-stdlib=libc++", "-std=c++11", "-I#{include}", "-I#{Formula["boost"].include}", "-I#{Formula["openssl"].include}", "-I#{Formula["cpprestsdk"].include}", "-L#{Formula["boost"].lib}", "-L#{Formula["cpprestsdk"].lib}", "-L#{Formula["openssl"].lib}", "-L#{lib}", "-lcpprest", "-lboost_system-mt", "-lssl", "-lcrypto", "-lazurestorage"] + ENV.cflags.to_s.split system ENV.cxx, "-o", "test_azurestoragecpp", "test.cpp", *flags system "./test_azurestoragecpp" end end