diff --git a/BUILD.gn b/BUILD.gn index 3be28fe6e0..107cde7bc1 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -97,6 +97,10 @@ config("common_inherited_config") { cflags = [] ldflags = [] + if (rtc_enable_symbol_export) { + defines = [ "WEBRTC_ENABLE_SYMBOL_EXPORT" ] + } + if (build_with_mozilla) { defines += [ "WEBRTC_MOZILLA_BUILD" ] } diff --git a/rtc_base/system/rtc_export.h b/rtc_base/system/rtc_export.h index b7a0fe4168..d1eb60ad78 100644 --- a/rtc_base/system/rtc_export.h +++ b/rtc_base/system/rtc_export.h @@ -16,7 +16,7 @@ // When WebRTC is built as a static library the RTC_EXPORT macro expands to // nothing. -#ifdef COMPONENT_BUILD +#ifdef WEBRTC_ENABLE_SYMBOL_EXPORT #ifdef WEBRTC_WIN @@ -34,7 +34,7 @@ #endif // WEBRTC_WIN -#endif // COMPONENT_BUILD +#endif // WEBRTC_ENABLE_SYMBOL_EXPORT #ifndef RTC_EXPORT #define RTC_EXPORT diff --git a/webrtc.gni b/webrtc.gni index 71c830e2bc..bba336912d 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -35,6 +35,10 @@ if (is_mac) { } 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 + # Setting this to true will define WEBRTC_EXCLUDE_FIELD_TRIAL_DEFAULT which # will tell the pre-processor to remove the default definition of symbols # needed to use field_trial. In that case a new implementation needs to be