diff --git a/webrtc/rtc_base/BUILD.gn b/webrtc/rtc_base/BUILD.gn index 6676fdf2ea..9572f179d2 100644 --- a/webrtc/rtc_base/BUILD.gn +++ b/webrtc/rtc_base/BUILD.gn @@ -428,6 +428,35 @@ rtc_source_set("rtc_json") { } rtc_static_library("rtc_base") { + public_deps = [ + ":rtc_base_generic", + ] + if (is_win) { + sources = [ + "noop.cc", + ] + } + if (is_ios || is_mac) { + sources = [ + "noop.mm", + ] + public_deps += [ ":rtc_base_objc" ] + } +} + +if (is_ios || is_mac) { + rtc_source_set("rtc_base_objc") { + sources = [ + "thread_darwin.mm", + ] + deps = [ + ":rtc_base_generic", + ] + visibility = [ ":rtc_base" ] + } +} + +rtc_static_library("rtc_base_generic") { cflags = [] cflags_cc = [] libs = [] @@ -537,6 +566,11 @@ rtc_static_library("rtc_base") { "thread.h", ] + visibility = [ + ":rtc_base", + ":rtc_base_objc", + ] + # TODO(henrike): issue 3307, make rtc_base build with the Chromium default # compiler settings. suppressed_configs += [ "//build/config/compiler:chromium_code" ] @@ -596,10 +630,7 @@ rtc_static_library("rtc_base") { } if (is_ios || is_mac) { - sources += [ - "macifaddrs_converter.cc", - "thread_darwin.mm", - ] + sources += [ "macifaddrs_converter.cc" ] } if (use_x11) { diff --git a/webrtc/rtc_base/noop.cc b/webrtc/rtc_base/noop.cc new file mode 100644 index 0000000000..16a8e6d5c1 --- /dev/null +++ b/webrtc/rtc_base/noop.cc @@ -0,0 +1,13 @@ +/* + * Copyright 2015 The WebRTC Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +// This file is only needed to make ninja happy on some platforms. +// On some platforms it is not possible to link an rtc_static_library +// without any source file listed in the GN target. diff --git a/webrtc/rtc_base/noop.mm b/webrtc/rtc_base/noop.mm new file mode 100644 index 0000000000..16a8e6d5c1 --- /dev/null +++ b/webrtc/rtc_base/noop.mm @@ -0,0 +1,13 @@ +/* + * Copyright 2015 The WebRTC Project Authors. All rights reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +// This file is only needed to make ninja happy on some platforms. +// On some platforms it is not possible to link an rtc_static_library +// without any source file listed in the GN target.