add gyp define to enable svn version check. defaults to off so tests built outside of svn will build/run with a warning but not error.

BUG=356
TESTED=set GYP_DEFINES=target_arch=ia32 libyuv_disable_jpeg=1 libyuv_enable_svn=1
R=thorcarpenter@google.com

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

git-svn-id: http://libyuv.googlecode.com/svn/trunk@1075 16f28f9a-4ce2-e073-06de-1de4eb20be90
This commit is contained in:
fbarchard@google.com 2014-09-05 00:33:53 +00:00
parent 3224e43e25
commit accefc4191
4 changed files with 10 additions and 3 deletions

View File

@ -1,6 +1,6 @@
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 1074 Version: 1075
License: BSD License: BSD
License File: LICENSE License File: LICENSE

View File

@ -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 1074 #define LIBYUV_VERSION 1075
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT

View File

@ -9,6 +9,7 @@
{ {
'variables': { 'variables': {
'libyuv_disable_jpeg%': 0, 'libyuv_disable_jpeg%': 0,
'libyuv_enable_svn%': 0,
}, },
'targets': [ 'targets': [
{ {
@ -21,7 +22,6 @@
'testing/gtest.gyp:gtest_main', 'testing/gtest.gyp:gtest_main',
], ],
'defines': [ 'defines': [
'LIBYUV_SVNREVISION="<!(svnversion -n)"',
# Enable the following 3 macros to turn off assembly for specified CPU. # Enable the following 3 macros to turn off assembly for specified CPU.
# 'LIBYUV_DISABLE_X86', # 'LIBYUV_DISABLE_X86',
# 'LIBYUV_DISABLE_NEON', # 'LIBYUV_DISABLE_NEON',
@ -49,6 +49,11 @@
'unit_test/version_test.cc', 'unit_test/version_test.cc',
], ],
'conditions': [ 'conditions': [
[ 'libyuv_enable_svn == 1', {
'defines': [
'LIBYUV_SVNREVISION="<!(svnversion -n)"',
],
}],
['OS=="linux"', { ['OS=="linux"', {
'cflags': [ 'cflags': [
'-fexceptions', '-fexceptions',

View File

@ -36,6 +36,8 @@ TEST_F(libyuvTest, TestVersion) {
if (LIBYUV_VERSION != svn_revision) { if (LIBYUV_VERSION != svn_revision) {
printf("WARNING - Versions do not match.\n"); printf("WARNING - Versions do not match.\n");
} }
#else
printf("WARNING - SVN Version unavailable. Test not run.\n");
#endif #endif
} }