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/v5.2.0.tar.gz" sha256 "c7e4cddd0d3c913ca1f367e3b5d84b5260311dcb33beaf2fefb66f821d2255fc" bottle do cellar :any sha256 "d113d3a9b40a1c1e804701ab91bf0bba9ec6ea5258f38ef4e9887f3e85a21a36" => :mojave sha256 "245d504aa58031cd17e0e22d94ab3a23ee33e0113962c5ea05db374407c1d688" => :high_sierra sha256 "9c2e8d60a2a270edcdb96dd42492644a271477e707268e6919312a52de2f4c15" => :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