From 9fde3e00865650009c7e85fcb7157719372b97a8 Mon Sep 17 00:00:00 2001 From: erikchen Date: Thu, 23 Apr 2015 17:41:50 -0700 Subject: [PATCH] mac: Weakly link against the CoreBluetooth framework. In the OSX 10.10 SDK, CoreBluetooth became a top level framework. Previously, it was nested in IOBluetooth. In order for Chrome to run on OSes older than OSX 10.10, the top level CoreBluetooth framework must be weakly linked. BUG=463170 Review URL: https://codereview.chromium.org/1101513003 Cr-Commit-Position: refs/heads/master@{#326705} --- device/BUILD.gn | 8 ++++++++ device/bluetooth/bluetooth.gyp | 13 +++++++++++++ 2 files changed, 21 insertions(+) diff --git a/device/BUILD.gn b/device/BUILD.gn index 3bf6fa77878d..becef455c1dc 100644 --- a/device/BUILD.gn +++ b/device/BUILD.gn @@ -112,5 +112,13 @@ test("device_unittests") { if (is_mac) { libs = [ "IOBluetooth.framework" ] + + # In the OSX 10.10 SDK, CoreBluetooth became a top level framework. + # Previously, it was nested in IOBluetooth. In order for Chrome to run on + # OSes older than OSX 10.10, the top level CoreBluetooth framework must be + # weakly linked. + if (mac_sdk_version == "10.10") { + ldflags = [ "-weak_framework CoreBluetooth" ] + } } } diff --git a/device/bluetooth/bluetooth.gyp b/device/bluetooth/bluetooth.gyp index 1e4f7edadbe1..ee671f528902 100644 --- a/device/bluetooth/bluetooth.gyp +++ b/device/bluetooth/bluetooth.gyp @@ -152,6 +152,19 @@ 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/IOBluetooth.framework', ], + 'conditions': [ + ['mac_sdk == "10.10"', { + 'xcode_settings': { + # In the OSX 10.10 SDK, CoreBluetooth became a top level + # framework. Previously, it was nested in IOBluetooth. In + # order for Chrome to run on OSes older than OSX 10.10, the + # top level CoreBluetooth framework must be weakly linked. + 'OTHER_LDFLAGS': [ + '-weak_framework CoreBluetooth', + ], + }, + }], + ], }, }], ], -- 2.11.4.GIT