Commit 56eb5a47 authored by VladimirTechMan's avatar VladimirTechMan Committed by Commit Bot

Allow enabling libyuv symbols visibility for shared library targets

When developing WebRTC applications with custom video sources, libyuv's
API is often the required part of the project. For that, application
developers can link with a separate standalone instance of libyuv.
However, it is even better to avoid that binary code duplication and
link against libyuv as a part compiled into the WebRTC library.

When building WebRTC as a static library target, the symbols from libyuv
are normally accessible to the linker without any extra actions. When
building WebRTC as a shared library, that does not work as the exported
symbols are those marked as visible, while libyuv is built with the
hidden visibility setting by default.

This patch adds an extra flag to enable switching the symbol visibility
to default when building shared library targets depending on libyuv in
WebRTC and Chromium projects. By default the flag is not enabled,
preserving the prior behaviour.

Bug: NONE
Change-Id: I48893cb9f54b1e1b49a34e14434e67f91d3e5e79
Reviewed-on: https://chromium-review.googlesource.com/827746Reviewed-by: 's avatarFrank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
parent 56480051
......@@ -12,6 +12,11 @@ import("//testing/test.gni")
declare_args() {
# Set to false to disable building with gflags.
libyuv_use_gflags = true
# When building a shared library using a target in WebRTC or
# Chromium projects that depends on libyuv, setting this flag
# to true makes libyuv symbols visible inside that library.
libyuv_symbols_visible = false
}
config("libyuv_config") {
......@@ -129,6 +134,11 @@ static_library("libyuv_internal") {
defines = []
deps = []
if (libyuv_symbols_visible) {
configs -= [ "//build/config/gcc:symbol_visibility_hidden" ]
configs += [ "//build/config/gcc:symbol_visibility_default" ]
}
if (!is_ios) {
defines += [ "HAVE_JPEG" ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment