From 8670ec53e44253862cd293e19ee120858170c433 Mon Sep 17 00:00:00 2001 From: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Date: Wed, 14 Jun 2023 15:24:49 +0800 Subject: [PATCH] libphonenumber: add workaround for new protobuf --- Formula/libphonenumber.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Formula/libphonenumber.rb b/Formula/libphonenumber.rb index 7bd312d8e316e..7648b791843a2 100644 --- a/Formula/libphonenumber.rb +++ b/Formula/libphonenumber.rb @@ -35,6 +35,8 @@ class Libphonenumber < Formula def install ENV.append_to_cflags "-Wno-sign-compare" # Avoid build failure on Linux. + # https://github.com/protocolbuffers/protobuf/commit/4329fde9cf3fab7d1b3a9abe0fbeee1ad8a8b111 + ENV.append_to_cflags "-DPROTOBUF_USE_DLLS" system "cmake", "-S", "cpp", "-B", "build", "-DCMAKE_CXX_STANDARD=17", # keep in sync with C++ standard in abseil.rb "-DGTEST_INCLUDE_DIR=#{Formula["googletest"].opt_include}", @@ -66,7 +68,7 @@ def install } } EOS - system ENV.cxx, "-std=c++17", "test.cpp", "-L#{lib}", "-lphonenumber", "-o", "test" + system ENV.cxx, "-std=c++17", "-DPROTOBUF_USE_DLLS", "test.cpp", "-L#{lib}", "-lphonenumber", "-o", "test" system "./test" end end