From ee99696592ecc147af74243dcf1709a39ca7f744 Mon Sep 17 00:00:00 2001 From: kjellander Date: Tue, 27 Sep 2016 12:13:13 -0700 Subject: [PATCH] Make 'webrtc' a static library. Most other targets were converted to static_library to match the GYP build in https://codereview.webrtc.org/2361623004. The monolithic 'webrtc' wasn't converted due to a limitation in libtool on Mac: it will fail if there are no object files to link (see http://crbug.com/625874). Because of that, a no_op_function.cc source file was added to the sources here, even if it's not used. This will be further refactored in the future as part of the Slim and Modular effort (bugs.webrtc.org/5716). BUG=webrtc:6418, webrtc:6410 NOTRY=True Review-Url: https://codereview.webrtc.org/2372983002 Cr-Commit-Position: refs/heads/master@{#14403} --- webrtc/BUILD.gn | 5 ++++- webrtc/build/no_op_function.cc | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 webrtc/build/no_op_function.cc 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 +