diff --git a/webrtc/build/webrtc.gni b/webrtc/build/webrtc.gni index 6459dae0ae..7fdd46280c 100644 --- a/webrtc/build/webrtc.gni +++ b/webrtc/build/webrtc.gni @@ -46,6 +46,7 @@ declare_args() { rtc_build_libjpeg = true rtc_build_libyuv = true rtc_build_libvpx = true + rtc_build_vp9 = true rtc_build_ssl = true # Disable by default. @@ -66,6 +67,10 @@ declare_args() { # https://gcc.gnu.org/wiki/LinkTimeOptimization rtc_use_lto = false + # Directly call the trace callback instead of passing it to a logging + # thread. Used for components that provide their own threaded logging. + rtc_use_direct_trace = false + if (build_with_chromium) { # Exclude pulse audio on Chromium since its prerequisites don't require # pulse audio. @@ -116,3 +121,9 @@ declare_args() { # //build/config/arm.gni (since it disables Neon for Android). rtc_build_armv7_neon = (cpu_arch == "arm" && arm_version >= 7) } + +# Make it possible to provide custom locations for some libraries (move these +# up into declare_args should we need to actually use them for the GN build). +rtc_libvpx_dir = "//third_party/libvpx" +rtc_libyuv_dir = "//third_party/libyuv" +rtc_opus_dir = "//third_party/opus" diff --git a/webrtc/common_video/BUILD.gn b/webrtc/common_video/BUILD.gn index 8085bceeb0..29998479c2 100644 --- a/webrtc/common_video/BUILD.gn +++ b/webrtc/common_video/BUILD.gn @@ -47,10 +47,10 @@ source_set("common_video") { deps = [ "../system_wrappers" ] if (rtc_build_libyuv) { - deps += [ "//third_party/libyuv" ] - public_deps = [ "//third_party/libyuv" ] + deps += [ "$rtc_libyuv_dir" ] + public_deps = [ "$rtc_libyuv_dir" ] } else { # Need to add a directory normally exported by libyuv. - include_dirs += [ "//third_party/libyuv/include" ] + include_dirs += [ "$rtc_libyuv_dir/include" ] } } diff --git a/webrtc/modules/audio_coding/BUILD.gn b/webrtc/modules/audio_coding/BUILD.gn index f4952a75b7..2577f34774 100644 --- a/webrtc/modules/audio_coding/BUILD.gn +++ b/webrtc/modules/audio_coding/BUILD.gn @@ -718,7 +718,7 @@ source_set("webrtc_opus") { configs += [ "../..:common_config" ] public_configs = [ "../..:common_inherited_config" ] - deps += [ "//third_party/opus" ] + deps += [ rtc_opus_dir ] } } @@ -806,7 +806,7 @@ source_set("neteq") { ":neteq_config", ] - forward_dependent_configs_from = [ "//third_party/opus" ] + forward_dependent_configs_from = [ rtc_opus_dir ] if (is_clang) { # Suppress warnings from Chrome's Clang plugins. @@ -825,6 +825,6 @@ source_set("neteq") { ":pcm16b", "../../common_audio", "../../system_wrappers", - "//third_party/opus", + rtc_opus_dir, ] } diff --git a/webrtc/modules/video_coding/BUILD.gn b/webrtc/modules/video_coding/BUILD.gn index 969ce8a084..353eca28d1 100644 --- a/webrtc/modules/video_coding/BUILD.gn +++ b/webrtc/modules/video_coding/BUILD.gn @@ -166,7 +166,7 @@ source_set("webrtc_vp8") { # TODO(kjellander): Remove once libvpx has changed it's libvpx_config to be # in direct_dependent_configs. - configs += [ "//third_party/libvpx:libvpx_config" ] + configs += [ "$rtc_libvpx_dir:libvpx_config" ] deps = [ ":video_coding_utility", @@ -175,17 +175,21 @@ source_set("webrtc_vp8") { ] if (rtc_build_libvpx) { deps += [ - "//third_party/libvpx", + rtc_libvpx_dir, ] } } source_set("webrtc_vp9") { - sources = [ - "codecs/vp9/include/vp9.h", - "codecs/vp9/vp9_impl.cc", - "codecs/vp9/vp9_impl.h", - ] + if (rtc_build_vp9) { + sources = [ + "codecs/vp9/include/vp9.h", + "codecs/vp9/vp9_impl.cc", + "codecs/vp9/vp9_impl.h", + ] + } else { + sources = [ "codecs/vp9/vp9_dummy_impl.cc" ] + } configs += [ "../..:common_config" ] public_configs = [ "../..:common_inherited_config" ] @@ -198,7 +202,7 @@ source_set("webrtc_vp9") { # TODO(kjellander): Remove once libvpx has changed it's libvpx_config to be # in direct_dependent_configs. - configs += [ "//third_party/libvpx:libvpx_config" ] + configs += [ "$rtc_libvpx_dir:libvpx_config" ] deps = [ ":video_coding_utility", @@ -207,7 +211,7 @@ source_set("webrtc_vp9") { ] if (rtc_build_libvpx) { deps += [ - "//third_party/libvpx", + rtc_libvpx_dir, ] } } diff --git a/webrtc/system_wrappers/BUILD.gn b/webrtc/system_wrappers/BUILD.gn index 23063f33de..720fa871db 100644 --- a/webrtc/system_wrappers/BUILD.gn +++ b/webrtc/system_wrappers/BUILD.gn @@ -122,6 +122,10 @@ static_library("system_wrappers") { libs = [] deps = [] + if (rtc_use_direct_trace) { + defines += [ "WEBRTC_DIRECT_TRACE" ] + } + if (is_android) { sources += [ "interface/logcat_trace_context.h",