From 94e43f8f8a2eae56803c43f7d8a4a329755ccfc3 Mon Sep 17 00:00:00 2001 From: Viktor Oreshkin Date: Sun, 18 Jun 2017 19:42:36 +0300 Subject: [PATCH] Fix openssl ldflags on macOS If ld finds ssl/crypto dylibs it prefers them to static archived objects And because of that produced .app links dynamically to openssl, so it won't launch unless users install openssl. There are two solutions: either uninstall openssl completely from build machine on each build, or use paths to .a files. Obviously latter is preferred. Signed-off-by: Viktor Oreshkin --- Telegram/gyp/telegram_mac.gypi | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Telegram/gyp/telegram_mac.gypi b/Telegram/gyp/telegram_mac.gypi index c3bce7f5f..c87eb4763 100644 --- a/Telegram/gyp/telegram_mac.gypi +++ b/Telegram/gyp/telegram_mac.gypi @@ -28,8 +28,6 @@ 'OTHER_LDFLAGS': [ '-lbsm', '-lm', - '-lssl', - '-lcrypto', '/usr/local/lib/liblzma.a', ], }, @@ -78,6 +76,8 @@ '/usr/local/macold/lib/libexif.a', '/usr/local/macold/lib/libc++.a', '/usr/local/macold/lib/libc++abi.a', + '<(libs_loc)/macold/openssl-1.0.1h/libssl.a', + '<(libs_loc)/macold/openssl-1.0.1h/libcrypto.a', ], }, 'include_dirs': [ @@ -87,9 +87,6 @@ '<(libs_loc)/macold/crashpad', '<(libs_loc)/macold/crashpad/third_party/mini_chromium/mini_chromium', ], - 'library_dirs': [ - '<(libs_loc)/macold/openssl-1.0.1h', - ], 'configurations': { 'Debug': { 'library_dirs': [ @@ -139,6 +136,8 @@ '/usr/local/lib/libavutil.a', '/usr/local/lib/libswscale.a', '/usr/local/lib/libswresample.a', + '<(libs_loc)/openssl-xcode/libssl.a', + '<(libs_loc)/openssl-xcode/libcrypto.a', ], }, 'include_dirs': [ @@ -146,9 +145,6 @@ '<(libs_loc)/crashpad/third_party/mini_chromium/mini_chromium', '<(libs_loc)/openssl-xcode/include' ], - 'library_dirs': [ - '<(libs_loc)/openssl-xcode', - ], 'configurations': { 'Debug': { 'library_dirs': [