diff options
author | Saurabh Saxena <srbs@google.com> | 2017-03-30 11:52:01 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-03-30 13:05:46 -0700 |
commit | 63b2f999d3f22cfe915b89103faa1b0a1b1b7617 (patch) | |
tree | 593eed2cb1ab751cf9574e0a8ba804d20f661d93 /third_party/snappy.BUILD | |
parent | 052e207e4f1076ac6b7464c01a67ecf4f986766d (diff) |
Enable snappy.
Fix implicit type cast bug in snappy_inputbuffer. Bitwise OR of unsigned int and signed char can cause unexpected issues so we explicitly cast it to unsigned char.
Change: 151737878
Diffstat (limited to 'third_party/snappy.BUILD')
-rw-r--r-- | third_party/snappy.BUILD | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/third_party/snappy.BUILD b/third_party/snappy.BUILD new file mode 100644 index 0000000000..37eebe291e --- /dev/null +++ b/third_party/snappy.BUILD @@ -0,0 +1,44 @@ +package(default_visibility = ["//visibility:public"]) + +licenses(["notice"]) # BSD 3-Clause + +exports_files(["COPYING"]) + +cc_library( + name = "snappy", + srcs = [ + "snappy.cc", + "snappy.h", + "snappy-c.cc", + "snappy-c.h", + "snappy-internal.h", + "snappy-sinksource.cc", + "snappy-sinksource.h", + "snappy-stubs-internal.cc", + "snappy-stubs-internal.h", + "snappy-stubs-public.h", + ], + hdrs = ["snappy.h"], + copts = [ + "-Wno-shift-negative-value", + "-Wno-implicit-function-declaration", + ], +) + +genrule( + name = "snappy_stubs_public_h", + srcs = ["snappy-stubs-public.h.in"], + outs = ["snappy-stubs-public.h"], + cmd = ("sed " + + "-e 's/@ac_cv_have_stdint_h@/1/g' " + + "-e 's/@ac_cv_have_stddef_h@/1/g' " + + "-e 's/@ac_cv_have_stdint_h@/1/g' " + + select({ + "@%ws%//tensorflow:windows": "-e 's/@ac_cv_have_sys_uio_h@/0/g' ", + "//conditions:default": "-e 's/@ac_cv_have_sys_uio_h@/1/g' ", + }) + + "-e 's/@SNAPPY_MAJOR@/1/g' " + + "-e 's/@SNAPPY_MINOR@/1/g' " + + "-e 's/@SNAPPY_PATCHLEVEL@/4/g' " + + "$< >$@"), +) |