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}
diff --git a/webrtc.gni b/webrtc.gni
index 184d13d..8b15e89 100644
--- a/webrtc.gni
+++ b/webrtc.gni
@@ -35,10 +35,22 @@
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 @@
# 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" ]