Commit 23d02ef2 authored by tfarina@chromium.org's avatar tfarina@chromium.org

Fixes to make possible to build snappy_unittest with gyp.

Currently it is not possible to build snappy_unittest target on Linux with the following command line:

$ ninja -C out/Debug snappy_unittest

This patch fixes this problem.

BUG=None
TEST=build snappy_unittest on Linux.
R=jsbell@chromium.org

Review URL: https://codereview.chromium.org/236323002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267102 0039d316-1c4b-4281-b951-d872f2087c98
parent 806e2aea
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define if building universal (internal helper macro) */
/* #undef AC_APPLE_UNIVERSAL_BUILD */
/* Define to 1 if the compiler supports __builtin_ctz and friends. */
#define HAVE_BUILTIN_CTZ 1
/* Define to 1 if the compiler supports __builtin_expect. */
#define HAVE_BUILTIN_EXPECT 1
/* Define to 1 if you have the <byteswap.h> header file. */
#define HAVE_BYTESWAP_H 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Use the gflags package for command-line parsing. */
/* #undef HAVE_GFLAGS */
/* Defined when Google Test is available. */
/* #undef HAVE_GTEST */
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the `fastlz' library (-lfastlz). */
/* #undef HAVE_LIBFASTLZ */
/* Define to 1 if you have the `lzf' library (-llzf). */
/* #undef HAVE_LIBLZF */
/* Define to 1 if you have the `lzo2' library (-llzo2). */
/* #undef HAVE_LIBLZO2 */
/* Define to 1 if you have the `quicklz' library (-lquicklz). */
/* #undef HAVE_LIBQUICKLZ */
/* Define to 1 if you have the `z' library (-lz). */
#define HAVE_LIBZ 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/byteswap.h> header file. */
/* #undef HAVE_SYS_BYTESWAP_H */
/* Define to 1 if you have the <sys/endian.h> header file. */
/* #undef HAVE_SYS_ENDIAN_H */
/* Define to 1 if you have the <sys/mman.h> header file. */
#define HAVE_SYS_MMAN_H 1
/* Define to 1 if you have the <sys/resource.h> header file. */
#define HAVE_SYS_RESOURCE_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if you have the <windows.h> header file. */
/* #undef HAVE_WINDOWS_H */
/* Define to the sub-directory in which libtool stores uninstalled libraries.
*/
#define LT_OBJDIR ".libs/"
/* Name of package */
#define PACKAGE "snappy"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
#define PACKAGE_NAME "snappy"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "snappy 1.1.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "snappy"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "1.1.0"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Version number of package */
#define VERSION "1.1.0"
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
/* # undef WORDS_BIGENDIAN */
# endif
#endif
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
/* Define to `int' if <sys/types.h> does not define. */
/* #undef ssize_t */
...@@ -40,28 +40,39 @@ ...@@ -40,28 +40,39 @@
'src/snappy.h', 'src/snappy.h',
], ],
'conditions': [ 'conditions': [
['OS=="win"', {
# Signed/unsigned comparison
'msvs_disabled_warnings': [
# https://code.google.com/p/snappy/issues/detail?id=71
4018,
# https://code.google.com/p/snappy/issues/detail?id=75
4267,
],
}],
['clang == 1', { ['clang == 1', {
# snappy-stubs-internal.h unapologetically has: using namespace std # snappy-stubs-internal.h unapologetically has: using namespace std
# https://code.google.com/p/snappy/issues/detail?id=70 # https://code.google.com/p/snappy/issues/detail?id=70
'xcode_settings': { 'xcode_settings': {
'WARNING_CFLAGS!': [ '-Wheader-hygiene' ], 'WARNING_CFLAGS!': [ '-Wheader-hygiene' ],
}, },
'cflags!': [ '-Wheader-hygiene' ], 'cflags': [ '-Wno-header-hygiene' ],
}], }],
['OS=="linux"', {
'defines': [
# TODO(tfarina): Only Linux has the generated config.h for now.
# Generate the config.h in the other platforms: mac, win and enable
# this for everyone.
'HAVE_CONFIG_H=1',
],
}],
['OS=="win"', {
# Signed/unsigned comparison
'msvs_disabled_warnings': [
# https://code.google.com/p/snappy/issues/detail?id=71
4018,
# https://code.google.com/p/snappy/issues/detail?id=75
4267,
],
}],
], ],
}, },
{ {
'target_name': 'snappy_unittest', 'target_name': 'snappy_unittest',
'type': 'executable', 'type': 'executable',
'defines': [
'HAVE_CONFIG_H=1',
],
'sources': [ 'sources': [
'src/snappy-test.cc', 'src/snappy-test.cc',
'src/snappy-test.h', 'src/snappy-test.h',
...@@ -73,6 +84,14 @@ ...@@ -73,6 +84,14 @@
'../../testing/gtest.gyp:gtest', '../../testing/gtest.gyp:gtest',
'../../third_party/zlib/zlib.gyp:zlib', '../../third_party/zlib/zlib.gyp:zlib',
], ],
'conditions': [
['clang == 1', {
'cflags': [
'-Wno-return-type',
'-Wno-header-hygiene'
],
}],
],
}, },
], ],
} }
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