From 33b9c8fb031dba53272627794338fc2725fb0090 Mon Sep 17 00:00:00 2001 From: Per Date: Fri, 15 Jul 2016 08:25:42 +0200 Subject: [PATCH] Move WEBRTC_BUILD_LIBEVENT definition to base/BUILD.gn and base/base.gyp. This use all_dependent_configs (GN) / all_dependent_settings (GYP) to export WEBRTC_BUILD_LIBEVENT to all dependent targets transitively. This fixes a problem with dependent projects in Chromium that indirectly include task_queue.h BUG=webrtc:5687 R=tommi@webrtc.org Review URL: https://codereview.webrtc.org/2153563003 . Cr-Commit-Position: refs/heads/master@{#13481} --- webrtc/BUILD.gn | 4 ---- webrtc/base/BUILD.gn | 5 +++++ webrtc/base/base.gyp | 4 ++++ webrtc/build/common.gypi | 5 ----- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn index 35cb24b50d..200d2e08cd 100644 --- a/webrtc/BUILD.gn +++ b/webrtc/BUILD.gn @@ -175,10 +175,6 @@ config("common_config") { } } - if (rtc_enable_libevent) { - defines += [ "WEBRTC_BUILD_LIBEVENT" ] - } - if (current_cpu == "arm64") { defines += [ "WEBRTC_ARCH_ARM64" ] defines += [ "WEBRTC_HAS_NEON" ] diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn index e7ed156ade..bcc6ad901e 100644 --- a/webrtc/base/BUILD.gn +++ b/webrtc/base/BUILD.gn @@ -187,6 +187,10 @@ static_library("rtc_base_approved") { } } +config("enable_libevent_config") { + defines = [ "WEBRTC_BUILD_LIBEVENT" ] +} + static_library("rtc_task_queue") { public_deps = [ ":rtc_base_approved", @@ -212,6 +216,7 @@ static_library("rtc_task_queue") { "task_queue_libevent.cc", "task_queue_posix.cc", ] + all_dependent_configs = [ ":enable_libevent_config" ] } else { if (is_mac || is_ios) { sources += [ diff --git a/webrtc/base/base.gyp b/webrtc/base/base.gyp index 38508ff29c..032281e42d 100644 --- a/webrtc/base/base.gyp +++ b/webrtc/base/base.gyp @@ -155,6 +155,10 @@ 'task_queue_libevent.cc', 'task_queue_posix.cc', ], + 'defines': [ 'WEBRTC_BUILD_LIBEVENT' ], + 'all_dependent_settings': { + 'defines': [ 'WEBRTC_BUILD_LIBEVENT' ] + }, }, { # If not libevent, fall back to the other task queues. 'conditions': [ diff --git a/webrtc/build/common.gypi b/webrtc/build/common.gypi index 36a2daedf0..2020c26b29 100644 --- a/webrtc/build/common.gypi +++ b/webrtc/build/common.gypi @@ -344,11 +344,6 @@ }], ], }], - ['enable_libevent==1', { - 'defines': [ - 'WEBRTC_BUILD_LIBEVENT', - ], - }], ['target_arch=="arm64"', { 'defines': [ 'WEBRTC_ARCH_ARM64',