From 11bea8977ebf8ef3e0654944023e1cb4ce63b814 Mon Sep 17 00:00:00 2001 From: "kjellander@webrtc.org" Date: Thu, 3 Jul 2014 17:04:12 +0000 Subject: [PATCH] GN: Implement BUILD.gn for common_video. This adds copying of Chromium's third_party/BUILD.gn to acommondate libyuv's BUILD.gn that imports the 'jpeg' config from that file. BUG=3441 TEST=trybots + local compile passing with: gn gen out/Default --args="build_with_chromium=false" && ninja -C out/Default gn gen out/Default --args="build_with_chromium=false build_libyuv=false" && ninja -C out/Default R=niklas.enbom@webrtc.org, pbos@webrtc.org Review URL: https://webrtc-codereview.appspot.com/14839004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6595 4adac7df-926f-26a2-2b94-8c16560cd09d --- .gitignore | 2 ++ DEPS | 11 +++++++++++ webrtc/build/webrtc.gni | 8 +++++++- webrtc/common_video/BUILD.gn | 36 ++++++++++++++++++++++++++++++++++-- 4 files changed, 54 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 911aade63..57808e3b8 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,8 @@ /third_party/android_tools /third_party/asan /third_party/binutils +/third_party/build_gn +/third_party/BUILD.gn /third_party/clang_format /third_party/colorama /third_party/cygwin diff --git a/DEPS b/DEPS index 485affaa4..8629afb99 100644 --- a/DEPS +++ b/DEPS @@ -48,6 +48,9 @@ deps = { "third_party/binutils": Var("chromium_trunk") + "/src/third_party/binutils@" + Var("chromium_revision"), + "third_party/build_gn": + File(Var("chromium_trunk") + "/src/third_party/BUILD.gn@" + Var("chromium_revision")), + "third_party/clang_format": Var("chromium_trunk") + "/src/third_party/clang_format@" + Var("chromium_revision"), @@ -244,6 +247,14 @@ hooks = [ Var("root_dir") + "/../chromium_gn/.gn", Var("root_dir")], }, + { + # Copy BUILD.gn from temporary place (third_party/build_gn) to third_party. + "name": "copy third_party/BUILD.gn", + "pattern": ".", + "action": ["python", Var("root_dir") + "/build/cp.py", + Var("root_dir") + "/third_party/build_gn/BUILD.gn", + Var("root_dir") + "/third_party"], + }, # Pull GN binaries. This needs to be before running GYP below. { "name": "gn_win", diff --git a/webrtc/build/webrtc.gni b/webrtc/build/webrtc.gni index 409ae1d23..281047a53 100644 --- a/webrtc/build/webrtc.gni +++ b/webrtc/build/webrtc.gni @@ -32,10 +32,16 @@ declare_args() { # which can be easily parsed for offline processing. enable_data_logging = false - build_libjpeg = true # Enables the use of protocol buffers for debug recordings. enable_protobuf = true + # Disable these to not build components which can be externally provided. + build_json = true + build_libjpeg = true + build_libyuv = true + build_libvpx = true + build_ssl = true + # Disable by default. have_dbus_glib = false diff --git a/webrtc/common_video/BUILD.gn b/webrtc/common_video/BUILD.gn index 2e877e6b9..69915e34c 100644 --- a/webrtc/common_video/BUILD.gn +++ b/webrtc/common_video/BUILD.gn @@ -8,6 +8,38 @@ import("../build/webrtc.gni") -source_set("common_video") { - # TODO(pbos): Implement. +config("common_video_config") { + include_dirs = [ + "interface", + "libyuv/include", + ] +} + +source_set("common_video") { + sources = [ + "i420_video_frame.cc", + "interface/i420_video_frame.h", + "interface/native_handle.h", + "interface/texture_video_frame.h", + "libyuv/include/scaler.h", + "libyuv/include/webrtc_libyuv.h", + "libyuv/scaler.cc", + "libyuv/webrtc_libyuv.cc", + "plane.cc", + "plane.h", + "texture_video_frame.cc" + ] + + include_dirs = [ "../modules/interface" ] + + direct_dependent_configs = [ ":common_video_config" ] + + deps = [ "../system_wrappers" ] + + if (build_libyuv) { + deps += [ "//third_party/libyuv" ] + } else { + # Need to add a directory normally exported by libyuv. + include_dirs += [ "//third_party/libyuv/include" ] + } }