From 09c60da70439c2dfd50c0aa377594d371d8be9b0 Mon Sep 17 00:00:00 2001 From: tommi Date: Tue, 24 May 2016 11:40:35 -0700 Subject: [PATCH] Split TaskQueue out into a separate build target. This is needed as there are targets such as newlib_pnacl/remoting_client_plugin_newlib.pexe that depend on rtc_base_approved but don't need TaskQueue. We could implement support for TaskQueue in nacl using ppapi types, but it looks like there isn't a need for it. Libevent isn't supported for nacl either, so I'm introducing a layer on top of rtc_base_approved for TaskQueue. It's conceivable that this target will morph into a target that holds other threading primitives such as platform_thread and possibly socket related operations, which is also an area that we currently #ifdef out for nacl in a few places. Functional change: Removes the "is_nacl" check. R=phoglund@webrtc.org Review-Url: https://codereview.webrtc.org/2001913002 Cr-Commit-Position: refs/heads/master@{#12878} --- webrtc/base/BUILD.gn | 16 ++++++++++++---- webrtc/base/base.gyp | 35 +++++++++++++++++++++++------------ webrtc/webrtc_tests.gypi | 1 + 3 files changed, 36 insertions(+), 16 deletions(-) diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn index 1e868b504e..9f7c7591ed 100644 --- a/webrtc/base/BUILD.gn +++ b/webrtc/base/BUILD.gn @@ -147,8 +147,6 @@ static_library("rtc_base_approved") { "swap_queue.h", "systeminfo.cc", "systeminfo.h", - "task_queue.h", - "task_queue_posix.h", "template_util.h", "thread_annotations.h", "thread_checker.h", @@ -174,17 +172,27 @@ static_library("rtc_base_approved") { "logging_mac.mm", ] } +} + +static_library("rtc_task_queue") { + public_deps = [ ":rtc_base_approved" ] + configs += [ "..:common_config" ] + + sources = [ + "task_queue.h", + "task_queue_posix.h", + ] if (rtc_build_libevent) { - deps += [ "//base/third_party/libevent" ] + deps = [ "//base/third_party/libevent" ] } + if (rtc_enable_libevent) { sources += [ "task_queue_libevent.cc", "task_queue_posix.cc", ] } else { - # If not libevent, fall back to the other task queues. if (is_mac || is_ios) { sources += [ "task_queue_gcd.cc", diff --git a/webrtc/base/base.gyp b/webrtc/base/base.gyp index 3efcf69c6b..7026599161 100644 --- a/webrtc/base/base.gyp +++ b/webrtc/base/base.gyp @@ -83,8 +83,6 @@ 'swap_queue.h', 'systeminfo.cc', 'systeminfo.h', - 'task_queue.h', - 'task_queue_posix.h', 'template_util.h', 'thread_annotations.h', 'thread_checker.h', @@ -113,6 +111,29 @@ 'logging_mac.mm', ], }], + ['OS=="mac" and build_with_chromium==0', { + 'all_dependent_settings': { + 'xcode_settings': { + 'OTHER_LDFLAGS': [ + # needed for logging_mac.mm + '-framework Foundation', + ], + }, + }, + }], # OS=="mac" and build_with_chromium==0 + ], + }, + { + 'target_name': 'rtc_task_queue', + 'type': 'static_library', + 'dependencies': [ + 'rtc_base_approved', + ], + 'sources': [ + 'task_queue.h', + 'task_queue_posix.h', + ], + 'conditions': [ ['build_libevent==1', { 'dependencies': [ '<(DEPTH)/base/third_party/libevent/libevent.gyp:libevent', @@ -137,16 +158,6 @@ }] ], }], - ['OS=="mac" and build_with_chromium==0', { - 'all_dependent_settings': { - 'xcode_settings': { - 'OTHER_LDFLAGS': [ - # needed for logging_mac.mm - '-framework Foundation', - ], - }, - }, - }], # OS=="mac" and build_with_chromium==0 ], }, { diff --git a/webrtc/webrtc_tests.gypi b/webrtc/webrtc_tests.gypi index ecba71a564..4ade4728f4 100644 --- a/webrtc/webrtc_tests.gypi +++ b/webrtc/webrtc_tests.gypi @@ -12,6 +12,7 @@ 'type': '<(gtest_target_type)', 'dependencies': [ 'base/base.gyp:rtc_base', + 'base/base.gyp:rtc_task_queue', 'base/base_tests.gyp:rtc_base_tests_utils', 'base/base_tests.gyp:rtc_base_tests', 'p2p/p2p.gyp:rtc_p2p',