diff options
Diffstat (limited to 'third_party/sqlite.BUILD')
-rw-r--r-- | third_party/sqlite.BUILD | 61 |
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"], ) |