aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/sqlite.BUILD
diff options
context:
space:
mode:
authorGravatar Justine Tunney <jart@google.com>2018-01-03 08:22:37 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-01-03 08:26:54 -0800
commit5d66ea93b2b17dbd4dcc886dcadc455b90bc6e08 (patch)
tree42b1ac42b55645d7d1fef08081191838b244a9f0 /third_party/sqlite.BUILD
parent0a2a5acbe38df2d1f869aa8d46167ad6d67f3da6 (diff)
Add Snappy support to SQLite
This change also puts the necessary build infrastructure in place so we can continue to build many proper lightweight SQLite extensions in the future that are easy for users to copy over into their own environments, so they can readily access their data. PiperOrigin-RevId: 180673039
Diffstat (limited to 'third_party/sqlite.BUILD')
-rw-r--r--third_party/sqlite.BUILD61
1 files changed, 54 insertions, 7 deletions
diff --git a/third_party/sqlite.BUILD b/third_party/sqlite.BUILD
index 9840d7b151..761838d194 100644
--- a/third_party/sqlite.BUILD
+++ b/third_party/sqlite.BUILD
@@ -1,16 +1,63 @@
# Description:
-# Sqlite3 library. Provides utilities for interacting
-# with sqlite3 databases.
+# sqlite3 is a serverless SQL RDBMS.
licenses(["unencumbered"]) # Public Domain
-# exports_files(["LICENSE"])
+SQLITE_COPTS = [
+ "-DHAVE_DECL_STRERROR_R=1",
+ "-DHAVE_STDINT_H=1",
+ "-DHAVE_INTTYPES_H=1",
+ "-D_FILE_OFFSET_BITS=64",
+ "-D_REENTRANT=1",
+] + select({
+ "@org_tensorflow//tensorflow:windows": [
+ "-DSQLITE_MAX_TRIGGER_DEPTH=100",
+ ],
+ "@org_tensorflow//tensorflow:windows_msvc": [
+ "-DSQLITE_MAX_TRIGGER_DEPTH=100",
+ ],
+ "@org_tensorflow//tensorflow:darwin": [
+ "-DHAVE_GMTIME_R=1",
+ "-DHAVE_LOCALTIME_R=1",
+ "-DHAVE_USLEEP=1",
+ ],
+ "//conditions:default": [
+ "-DHAVE_FDATASYNC=1",
+ "-DHAVE_GMTIME_R=1",
+ "-DHAVE_LOCALTIME_R=1",
+ "-DHAVE_POSIX_FALLOCATE=1",
+ "-DHAVE_USLEEP=1",
+ ],
+})
+# Production build of SQLite library that's baked into TensorFlow.
cc_library(
- name = "sqlite",
+ name = "org_sqlite",
srcs = ["sqlite3.c"],
- hdrs = ["sqlite3.h"],
- includes = ["."],
- linkopts = ["-lm"],
+ hdrs = [
+ "sqlite3.h",
+ "sqlite3ext.h",
+ ],
+ copts = SQLITE_COPTS,
+ defines = [
+ # This gets rid of the bloat of deprecated functionality. It
+ # needs to be listed here instead of copts because it's actually
+ # referenced in the sqlite3.h file.
+ "SQLITE_OMIT_DEPRECATED",
+ ],
+ linkopts = select({
+ "@org_tensorflow//tensorflow:windows_msvc": [],
+ "//conditions:default": [
+ "-ldl",
+ "-lpthread",
+ ],
+ }),
+ visibility = ["//visibility:public"],
+)
+
+# This is a Copybara sync helper for Google.
+py_library(
+ name = "python",
+ srcs_version = "PY2AND3",
visibility = ["//visibility:public"],
)