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}
This commit is contained in:
tommi
2016-05-24 11:40:35 -07:00
committed by Commit bot
parent 1b32acdbd0
commit 09c60da704
3 changed files with 36 additions and 16 deletions

View File

@ -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",

View File

@ -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
],
},
{

View File

@ -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',