diff options
author | Christian Brauner <christian.brauner@canonical.com> | 2016-10-17 14:28:16 +0200 |
---|---|---|
committer | Christian Brauner <christian.brauner@canonical.com> | 2016-10-28 10:28:17 +0200 |
commit | f6e7921d24a633f15e039189b0c06889f0c5e4a5 (patch) | |
tree | dcbb01b3e8a22506512efac47a5a34880e0da134 /sqlite3ext.h | |
parent | Merge pull request #333 from nyarly/master (diff) | |
download | golite-f6e7921d24a633f15e039189b0c06889f0c5e4a5.tar.gz golite-f6e7921d24a633f15e039189b0c06889f0c5e4a5.tar.xz |
actually link to <sqlite3.h> 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 <christian.brauner@canonical.com>
Diffstat (limited to 'sqlite3ext.h')
-rw-r--r-- | sqlite3ext.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sqlite3ext.h b/sqlite3ext.h index ce87e74..0c28610 100644 --- a/sqlite3ext.h +++ b/sqlite3ext.h @@ -1,3 +1,4 @@ +#ifndef USE_LIBSQLITE3 /* ** 2006 June 7 ** @@ -12,7 +13,7 @@ ** This header file defines the SQLite interface for use by ** shared libraries that want to be imported as extensions into ** an SQLite instance. Shared libraries that intend to be loaded -** as extensions by SQLite should #include this file instead of +** as extensions by SQLite should #include this file instead of ** sqlite3.h. */ #ifndef SQLITE3EXT_H @@ -543,14 +544,14 @@ typedef int (*sqlite3_loadext_entry)( #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */ #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) - /* This case when the file really is being compiled as a loadable + /* This case when the file really is being compiled as a loadable ** extension */ # define SQLITE_EXTENSION_INIT1 const sqlite3_api_routines *sqlite3_api=0; # define SQLITE_EXTENSION_INIT2(v) sqlite3_api=v; # define SQLITE_EXTENSION_INIT3 \ extern const sqlite3_api_routines *sqlite3_api; #else - /* This case when the file is being statically linked into the + /* This case when the file is being statically linked into the ** application */ # define SQLITE_EXTENSION_INIT1 /*no-op*/ # define SQLITE_EXTENSION_INIT2(v) (void)v; /* unused parameter */ @@ -558,3 +559,7 @@ typedef int (*sqlite3_loadext_entry)( #endif #endif /* SQLITE3EXT_H */ +#else // USE_LIBSQLITE3 + // If users really want to link against the system sqlite3 we +// need to make this file a noop. + #endif |