Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go-sqlite3 with static library #557

Closed
Stoyvo opened this issue May 2, 2018 · 1 comment
Closed

go-sqlite3 with static library #557

Stoyvo opened this issue May 2, 2018 · 1 comment

Comments

@Stoyvo
Copy link

Stoyvo commented May 2, 2018

Thanks for go-sqlite3!

It is difficult to find documentation on how to reference a custom build sqlite3 library (EG: libsqlcipher-osx.a)

Currently I can use such library if I edit sqlite3.go and add:

#cgo CFLAGS: -I/Development/sqlcipher/sqlcipher-static-osx/include
#cgo LDFLAGS: /Development/sqlcipher/sqlcipher-static-osx/osx-libs/libsqlcipher-osx.a -framework Security -framework Foundation

and build with:
go build -tags libsqlite3 -v -ldflags "-s -w"

However this requires a very specific change to the package and bad practice.

How do we specify these LD and C flags without modifying the package?

@mattn
Copy link
Owner

mattn commented May 5, 2018

You can use CGO_CFLAGS and CGO_LDFLAGS environment variables.

gjrtimmer added a commit to gjrtimmer/go-sqlite3 that referenced this issue May 26, 2018
Compile Section Closes mattn#175
Compile Section Closes mattn#201
Compile Section Closes mattn#206
Compile Section Closes mattn#404
Compile Section Closes mattn#217
Compile Section Closes mattn#224
Compile Section Closes mattn#234
Compile Section Closes mattn#242
Feature table Closes mattn#255
Description Section Closes mattn#232
Golang:1.6 not supported Closes mattn#272
Golang:1.5 not supported + compilation section Closes mattn#283
usleep Implemented Closes mattn#285
FAQ Section Closes mattn#289
Compile Section closes mattn#295
FAQ Section Closes mattn#305
PR339 Closes mattn#318 mattn#321
Compilation Section Closes mattn#341
PR407 Closes mattn#364
Feature `sqlite_vtable` Closes mattn#393
Compile Section Closes mattn#416
sqlite_trace feature Closes mattn#433
Compilation Section Closes mattn#435
Compilation Section Closes mattn#443
Golang:1.6 Not Supported Closes mattn#445
Compilation Section Closes mattn#451
Compilation Section Closes mattn#467
Compilation Section Closes mattn#491
Compilation Section Closes mattn#495
Compilation Section Closes mattn#505
Compilation Section Closes mattn#557
Compilation Section Closes mattn#560
@mattn mattn closed this as completed in c9394b1 May 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants