From 0d8da8a372f279dee94660fc771d75ddff2cbf44 Mon Sep 17 00:00:00 2001 From: "sergeyu@google.com" Date: Tue, 14 Jan 2014 01:01:19 +0000 Subject: [PATCH] Compile libyuv for PNaCl. New target libyuv_untrusted compiles libyuv for PNaCl. BUG=276739 R=fbarchard@google.com Review URL: https://webrtc-codereview.appspot.com/6299004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@969 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- libyuv.gyp | 57 +++-------------------------------------- libyuv.gypi | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ libyuv_nacl.gyp | 40 +++++++++++++++++++++++++++++ 3 files changed, 111 insertions(+), 53 deletions(-) create mode 100644 libyuv.gypi create mode 100644 libyuv_nacl.gyp diff --git a/libyuv.gyp b/libyuv.gyp index 56f9d3419..f2cb8cdd5 100644 --- a/libyuv.gyp +++ b/libyuv.gyp @@ -7,6 +7,9 @@ # be found in the AUTHORS file in the root of the source tree. { + 'includes': [ + 'libyuv.gypi', + ], 'variables': { 'use_system_libjpeg%': 0, 'build_neon': 0, @@ -120,59 +123,7 @@ ], }, 'sources': [ - # includes. - 'include/libyuv.h', - 'include/libyuv/basic_types.h', - 'include/libyuv/compare.h', - 'include/libyuv/convert.h', - 'include/libyuv/convert_argb.h', - 'include/libyuv/convert_from.h', - 'include/libyuv/convert_from_argb.h', - 'include/libyuv/cpu_id.h', - 'include/libyuv/format_conversion.h', - 'include/libyuv/mjpeg_decoder.h', - 'include/libyuv/planar_functions.h', - 'include/libyuv/rotate.h', - 'include/libyuv/rotate_argb.h', - 'include/libyuv/row.h', - 'include/libyuv/scale.h', - 'include/libyuv/scale_argb.h', - 'include/libyuv/scale_row.h', - 'include/libyuv/version.h', - 'include/libyuv/video_common.h', - - # sources. - 'source/compare.cc', - 'source/compare_common.cc', - 'source/compare_posix.cc', - 'source/compare_win.cc', - 'source/convert.cc', - 'source/convert_argb.cc', - 'source/convert_from.cc', - 'source/convert_from_argb.cc', - 'source/convert_jpeg.cc', - 'source/convert_to_argb.cc', - 'source/convert_to_i420.cc', - 'source/cpu_id.cc', - 'source/format_conversion.cc', - 'source/mjpeg_decoder.cc', - 'source/mjpeg_validate.cc', - 'source/planar_functions.cc', - 'source/rotate.cc', - 'source/rotate_argb.cc', - 'source/rotate_mips.cc', - 'source/row_any.cc', - 'source/row_common.cc', - 'source/row_mips.cc', - 'source/row_posix.cc', - 'source/row_win.cc', - 'source/scale.cc', - 'source/scale_argb.cc', - 'source/scale_common.cc', - 'source/scale_mips.cc', - 'source/scale_posix.cc', - 'source/scale_win.cc', - 'source/video_common.cc', + '<@(libyuv_sources)', ], }, ], # targets. diff --git a/libyuv.gypi b/libyuv.gypi new file mode 100644 index 000000000..fd8b38a26 --- /dev/null +++ b/libyuv.gypi @@ -0,0 +1,67 @@ +# Copyright 2014 The LibYuv Project Authors. All rights reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +{ + 'variables': { + 'libyuv_sources': [ + # includes. + 'include/libyuv.h', + 'include/libyuv/basic_types.h', + 'include/libyuv/compare.h', + 'include/libyuv/convert.h', + 'include/libyuv/convert_argb.h', + 'include/libyuv/convert_from.h', + 'include/libyuv/convert_from_argb.h', + 'include/libyuv/cpu_id.h', + 'include/libyuv/format_conversion.h', + 'include/libyuv/mjpeg_decoder.h', + 'include/libyuv/planar_functions.h', + 'include/libyuv/rotate.h', + 'include/libyuv/rotate_argb.h', + 'include/libyuv/row.h', + 'include/libyuv/scale.h', + 'include/libyuv/scale_argb.h', + 'include/libyuv/scale_row.h', + 'include/libyuv/version.h', + 'include/libyuv/video_common.h', + + # sources. + 'source/compare.cc', + 'source/compare_common.cc', + 'source/compare_posix.cc', + 'source/compare_win.cc', + 'source/convert.cc', + 'source/convert_argb.cc', + 'source/convert_from.cc', + 'source/convert_from_argb.cc', + 'source/convert_jpeg.cc', + 'source/convert_to_argb.cc', + 'source/convert_to_i420.cc', + 'source/cpu_id.cc', + 'source/format_conversion.cc', + 'source/mjpeg_decoder.cc', + 'source/mjpeg_validate.cc', + 'source/planar_functions.cc', + 'source/rotate.cc', + 'source/rotate_argb.cc', + 'source/rotate_mips.cc', + 'source/row_any.cc', + 'source/row_common.cc', + 'source/row_mips.cc', + 'source/row_posix.cc', + 'source/row_win.cc', + 'source/scale.cc', + 'source/scale_argb.cc', + 'source/scale_common.cc', + 'source/scale_mips.cc', + 'source/scale_posix.cc', + 'source/scale_win.cc', + 'source/video_common.cc', + ], + } +} diff --git a/libyuv_nacl.gyp b/libyuv_nacl.gyp new file mode 100644 index 000000000..1dacac097 --- /dev/null +++ b/libyuv_nacl.gyp @@ -0,0 +1,40 @@ +# Copyright 2014 The LibYuv Project Authors. All rights reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +{ + 'includes': [ + 'libyuv.gypi', + '../../native_client/build/untrusted.gypi', + ], + 'targets': [ + { + 'target_name': 'libyuv_nacl', + 'type': 'none', + 'variables': { + 'nlib_target': 'libyuv_nacl.a', + 'build_glibc': 0, + 'build_newlib': 0, + 'build_pnacl_newlib': 1, + }, + 'dependencies': [ + '../../native_client/tools.gyp:prep_toolchain', + ], + 'include_dirs': [ + 'include', + ], + 'direct_dependent_settings': { + 'include_dirs': [ + 'include', + ], + }, + 'sources': [ + '<@(libyuv_sources)', + ], + }, # target libyuv_nacl + ] +}