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