Commit 455c66b4 authored by fbarchard@google.com's avatar fbarchard@google.com

Add a gyp define LIBYUV_DISABLE_JPEG to not build jpeg library

BUG=346
TESTED=set GYP_DEFINES=target_arch=ia32 libyuv_disable_jpeg=1 & python gyp_libyuv -fninja -G msvs_version=2010 libyuv_test.gyp
R=harryjin@google.com

Review URL: https://webrtc-codereview.appspot.com/16989004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@1038 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 9f12361e
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 1037 Version: 1038
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 1037 #define LIBYUV_VERSION 1038
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
], ],
'variables': { 'variables': {
'use_system_libjpeg%': 0, 'use_system_libjpeg%': 0,
'libyuv_disable_jpeg%': 0,
'build_neon': 0, 'build_neon': 0,
'conditions': [ 'conditions': [
[ '(target_arch == "armv7" or target_arch == "armv7s" or (target_arch == "arm" and arm_version >= 7)) and target_subarch != 64 and (arm_neon == 1 or arm_neon_optional == 1)', { [ '(target_arch == "armv7" or target_arch == "armv7s" or (target_arch == "arm" and arm_version >= 7)) and target_subarch != 64 and (arm_neon == 1 or arm_neon_optional == 1)', {
...@@ -71,8 +72,7 @@ ...@@ -71,8 +72,7 @@
'LIBYUV_DISABLE_NEON' 'LIBYUV_DISABLE_NEON'
], ],
}], }],
# TODO(fbarchard): Use gyp define to enable jpeg. [ 'OS != "ios" and libyuv_disable_jpeg != 1', {
[ 'OS != "ios"', {
'defines': [ 'defines': [
'HAVE_JPEG' 'HAVE_JPEG'
], ],
......
...@@ -7,6 +7,9 @@ ...@@ -7,6 +7,9 @@
# be found in the AUTHORS file in the root of the source tree. # be found in the AUTHORS file in the root of the source tree.
{ {
'variables': {
'libyuv_disable_jpeg%': 0,
},
'targets': [ 'targets': [
{ {
'target_name': 'libyuv_unittest', 'target_name': 'libyuv_unittest',
...@@ -62,7 +65,7 @@ ...@@ -62,7 +65,7 @@
'DEBUG_INFORMATION_FORMAT' : 'dwarf-with-dsym', 'DEBUG_INFORMATION_FORMAT' : 'dwarf-with-dsym',
}, },
}], }],
[ 'OS != "ios"', { [ 'OS != "ios" and libyuv_disable_jpeg != 1', {
'defines': [ 'defines': [
'HAVE_JPEG', 'HAVE_JPEG',
], ],
...@@ -116,22 +119,24 @@ ...@@ -116,22 +119,24 @@
'util/psnr.cc', 'util/psnr.cc',
'util/ssim.cc', 'util/ssim.cc',
], ],
'dependencies': [
'libyuv.gyp:libyuv',
],
'conditions': [ 'conditions': [
[ 'OS == "ios" and target_subarch == 64', { [ 'OS == "ios" and target_subarch == 64', {
'defines': [ 'defines': [
'LIBYUV_DISABLE_NEON' 'LIBYUV_DISABLE_NEON'
], ],
}], }],
[ 'OS != "ios"', {
[ 'OS != "ios" and libyuv_disable_jpeg != 1', {
'defines': [ 'defines': [
'HAVE_JPEG', 'HAVE_JPEG',
], ],
}], }],
], # conditions ], # conditions
'dependencies': [
'libyuv.gyp:libyuv',
],
}, },
{ {
'target_name': 'cpuid', 'target_name': 'cpuid',
'type': 'executable', 'type': 'executable',
......
...@@ -1253,4 +1253,12 @@ TEST_F(libyuvTest, CropNV12) { ...@@ -1253,4 +1253,12 @@ TEST_F(libyuvTest, CropNV12) {
free_aligned_buffer_64(src_y); free_aligned_buffer_64(src_y);
} }
TEST_F(libyuvTest, HaveJPEG) {
#ifdef HAVE_JPEG
printf("JPEG enabled\n.");
#else
printf("JPEG disabled\n.");
#endif
}
} // namespace libyuv } // namespace libyuv
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