mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 05:40:42 +01:00
Allow export of Obj-C symbols without C++ ones.
This is useful when building the .framework which doesn't need to export C++ symbols. Bug: webrtc:12408 Change-Id: Ied775811a72a06b9ad678c9fb549bca286dd7f37 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227089 Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/master@{#34613}
This commit is contained in:
parent
8e70299dd9
commit
5f0784563c
4 changed files with 19 additions and 6 deletions
3
BUILD.gn
3
BUILD.gn
|
@ -121,6 +121,9 @@ config("common_inherited_config") {
|
|||
if (rtc_enable_symbol_export || is_component_build) {
|
||||
defines = [ "WEBRTC_ENABLE_SYMBOL_EXPORT" ]
|
||||
}
|
||||
if (rtc_enable_objc_symbol_export) {
|
||||
defines = [ "WEBRTC_ENABLE_OBJC_SYMBOL_EXPORT" ]
|
||||
}
|
||||
|
||||
if (build_with_mozilla) {
|
||||
defines += [ "WEBRTC_MOZILLA_BUILD" ]
|
||||
|
|
|
@ -11,13 +11,13 @@
|
|||
#ifndef SDK_OBJC_BASE_RTCMACROS_H_
|
||||
#define SDK_OBJC_BASE_RTCMACROS_H_
|
||||
|
||||
#ifdef WEBRTC_ENABLE_SYMBOL_EXPORT
|
||||
#ifdef WEBRTC_ENABLE_OBJC_SYMBOL_EXPORT
|
||||
|
||||
#if defined(WEBRTC_LIBRARY_IMPL)
|
||||
#define RTC_OBJC_EXPORT __attribute__((visibility("default")))
|
||||
#endif
|
||||
|
||||
#endif // WEBRTC_ENABLE_SYMBOL_EXPORT
|
||||
#endif // WEBRTC_ENABLE_OBJC_SYMBOL_EXPORT
|
||||
|
||||
#ifndef RTC_OBJC_EXPORT
|
||||
#define RTC_OBJC_EXPORT
|
||||
|
|
|
@ -183,7 +183,7 @@ def BuildWebRTC(output_dir, target_environment, target_arch, flavor,
|
|||
gn_args.append('enable_ios_bitcode=' +
|
||||
('true' if use_bitcode else 'false'))
|
||||
gn_args.append('use_goma=' + ('true' if use_goma else 'false'))
|
||||
gn_args.append('rtc_enable_symbol_export=true')
|
||||
gn_args.append('rtc_enable_objc_symbol_export=true')
|
||||
|
||||
args_string = ' '.join(gn_args + extra_gn_args)
|
||||
logging.info('Building WebRTC with args: %s', args_string)
|
||||
|
|
16
webrtc.gni
16
webrtc.gni
|
@ -35,10 +35,22 @@ if (is_mac) {
|
|||
import("//build/config/mac/rules.gni")
|
||||
}
|
||||
|
||||
# This declare_args is separated from the next one because args declared
|
||||
# in this one, can be read from the next one (args defined in the same
|
||||
# declare_args cannot be referenced in that scope).
|
||||
declare_args() {
|
||||
# Setting this to true will make RTC_EXPORT (see rtc_base/system/rtc_export.h)
|
||||
# expand to code that will manage symbols visibility.
|
||||
rtc_enable_symbol_export = false
|
||||
}
|
||||
|
||||
declare_args() {
|
||||
# Setting this to true will make RTC_OBJC_EXPORT expand to code that will
|
||||
# manage symbols visibility. By default, Obj-C/Obj-C++ symbols are exported
|
||||
# if C++ symbols are but setting this arg to true while keeping
|
||||
# rtc_enable_symbol_export=false will only export RTC_OBJC_EXPORT
|
||||
# annotated symbols.
|
||||
rtc_enable_objc_symbol_export = rtc_enable_symbol_export
|
||||
|
||||
# Setting this to true will define WEBRTC_EXCLUDE_FIELD_TRIAL_DEFAULT which
|
||||
# will tell the pre-processor to remove the default definition of symbols
|
||||
|
@ -320,9 +332,7 @@ webrtc_root = get_path_info(".", "abspath")
|
|||
# It sets defines, include paths and compilation warnings accordingly,
|
||||
# both for WebRTC stand-alone builds and for the scenario when WebRTC
|
||||
# native code is built as part of Chromium.
|
||||
rtc_common_configs = [
|
||||
webrtc_root + ":common_config",
|
||||
]
|
||||
rtc_common_configs = [ webrtc_root + ":common_config" ]
|
||||
|
||||
if (is_mac || is_ios) {
|
||||
rtc_common_configs += [ "//build/config/compiler:enable_arc" ]
|
||||
|
|
Loading…
Reference in a new issue