From b1f1406e0667ea5247d36f0b0555e336fb2e1549 Mon Sep 17 00:00:00 2001 From: kjellander Date: Mon, 25 Apr 2016 00:01:36 -0700 Subject: [PATCH] GN: Refactor webrtc/base/BUILD.gn Move the all_dependent_configs configurations into a single config for better readability. Sync the Mac and iOS frameworks between the GYP and the GN build. Many entries that used to be default included in https://code.google.com/p/chromium/codesearch#chromium/src/build/config/BUILD.gn are no longer implicitly added for Mac, so to ensure they are they're added back for the Mac build. NOTRY=True Review URL: https://codereview.webrtc.org/1914913002 Cr-Commit-Position: refs/heads/master@{#12484} --- webrtc/base/BUILD.gn | 60 ++++++++++++++++++-------------------------- 1 file changed, 24 insertions(+), 36 deletions(-) diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn index 73382f19fa..5d93c5ac3c 100644 --- a/webrtc/base/BUILD.gn +++ b/webrtc/base/BUILD.gn @@ -47,34 +47,29 @@ config("openssl_config") { ] } -config("ios_config") { - libs = [ - "AVFoundation.framework", - "CFNetwork.framework", +config("rtc_base_all_dependent_config") { + if (is_ios) { + libs = [ + "CFNetwork.framework", - #"Foundation.framework", # Already included in //build/config:default_libs. - "Security.framework", - "SystemConfiguration.framework", - - #"UIKit.framework", # Already included in //build/config:default_libs. - ] -} - -config("mac_config") { - libs = [ - "Cocoa.framework", - - #"Foundation.framework", # Already included in //build/config:default_libs. - #"IOKit.framework", # Already included in //build/config:default_libs. - #"Security.framework", # Already included in //build/config:default_libs. - "SystemConfiguration.framework", - ] -} - -config("mac_x86_config") { - libs = [ - #"Carbon.framework", # Already included in //build/config:default_libs. - ] + #"Foundation.framework", # Already in //build/config:default_libs. + "Security.framework", + "SystemConfiguration.framework", + "UIKit.framework", # Already in //build/config:default_libs. + ] + } + if (is_mac) { + libs = [ + "Cocoa.framework", + "Foundation.framework", + "IOKit.framework", + "Security.framework", + "SystemConfiguration.framework", + ] + if (current_cpu == "x86") { + libs = [ "Carbon.framework" ] # Already in //build/config:default_libs. + } + } } if (is_linux && !build_with_chromium) { @@ -209,6 +204,8 @@ static_library("rtc_base") { ":rtc_base_config", ] + all_dependent_configs = [ ":rtc_base_all_dependent_config" ] + defines = [ "LOGGING=1" ] sources = [ @@ -495,9 +492,6 @@ static_library("rtc_base") { } if (is_ios || is_mac) { - if (is_ios) { - all_dependent_configs = [ ":ios_config" ] - } sources += [ "maccocoathreadhelper.h", "maccocoathreadhelper.mm", @@ -536,12 +530,6 @@ static_library("rtc_base") { "macutils.cc", "macutils.h", ] - - all_dependent_configs = [ ":mac_config" ] - - if (current_cpu == "x86") { - all_dependent_configs += [ ":mac_x86_config" ] - } } if (is_win) {