Skip to content

go-sqlite3 with static library #557

Closed
@Stoyvo

Description

@Stoyvo

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions