diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn index 96216e7401..9ac939df35 100644 --- a/webrtc/BUILD.gn +++ b/webrtc/BUILD.gn @@ -240,8 +240,11 @@ config("common_objc") { } if (!is_ios || !build_with_chromium) { - rtc_source_set("webrtc") { + rtc_static_library("webrtc") { sources = [ + # TODO(kjellander): Remove this whenever possible. GN's static_library + # target type requires at least one object to avoid errors linking. + "build/no_op_function.cc", "call.h", "config.h", "transport.h", diff --git a/webrtc/build/no_op_function.cc b/webrtc/build/no_op_function.cc new file mode 100644 index 0000000000..4c10e37d39 --- /dev/null +++ b/webrtc/build/no_op_function.cc @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2016 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. + */ + +namespace webrtc { + +// TODO(kjellander): Remove this whenever possible. GN's static_library +// target type requires at least one object to avoid errors linking. + +// No-op function that can be used to compile an object necessary +// for linking into a static library. +int foobarbaz() { + return 0; +} + +} // namespace webrtc +