From f6e7921d24a633f15e039189b0c06889f0c5e4a5 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Mon, 17 Oct 2016 14:28:16 +0200 Subject: actually link to when -tags libsqlite3 Building with -tags libsqlite3 used the sqlite3.h from the system but the go compiler will compile all *.{c,h} files in the same direcory: "When the Go tool sees that one or more Go files use the special import "C", it will look for other non-Go files in the directory and compile them as part of the Go package. Any .c, .s, or .S files will be compiled with the C compiler." (https://golang.org/cmd/cgo/) So if users actually want to link against the system sqlite3 we should make sqlite3-binding.* a noop. Signed-off-by: Christian Brauner --- sqlite3-binding.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sqlite3-binding.c') diff --git a/sqlite3-binding.c b/sqlite3-binding.c index 1f085b0..a8790de 100644 --- a/sqlite3-binding.c +++ b/sqlite3-binding.c @@ -17,6 +17,7 @@ ** language. The code for the "sqlite3" command-line shell is also in a ** separate file. This file contains only code for the core SQLite library. */ +#ifndef USE_LIBSQLITE3 #define SQLITE_CORE 1 #define SQLITE_AMALGAMATION 1 #ifndef SQLITE_PRIVATE @@ -197846,5 +197847,9 @@ static int sqlite3Fts5VocabInit(Fts5Global *pGlobal, sqlite3 *db){ #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5) */ +#else // USE_LIBSQLITE3 +// If users really want to link against the system sqlite3 we +// need to make this file a noop. +#endif /************** End of fts5.c ************************************************/ -- cgit v1.2.3