From 9a28bef30af0bb4c50e486a7d7c109f4f458bfb9 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Mon, 2 Dec 2024 14:23:28 +0100 Subject: [PATCH] extconf.rb: locate zstd when using homebrew Fix compilation issues on my system. --- ext/mysql2/extconf.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/mysql2/extconf.rb b/ext/mysql2/extconf.rb index aaf6b255..147b998b 100644 --- a/ext/mysql2/extconf.rb +++ b/ext/mysql2/extconf.rb @@ -63,7 +63,12 @@ def add_ssl_defines(header) # Homebrew OpenSSL on MacOS elsif RUBY_PLATFORM =~ /darwin/ && system('command -v brew') openssl_location = `brew --prefix openssl`.strip - $LDFLAGS << " -L#{openssl_location}/lib" if openssl_location + $LIBPATH << "#{openssl_location}/lib" unless openssl_location.empty? +end + +if RUBY_PLATFORM =~ /darwin/ && system('command -v brew') + zstd_location = `brew --prefix zstd`.strip + $LIBPATH << "#{zstd_location}/lib" unless zstd_location.empty? end ### Find MySQL client library