Skip to content

Commit a04d133

Browse files
committed
build flags for other platforms
1 parent d120b96 commit a04d133

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

conn.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,19 @@ package sqlite
5959
#cgo CFLAGS: -DSQLITE_OMIT_UTF16=1
6060
6161
// PLATFORM FEATURES
62-
#cgo CFLAGS: -DHAVE_FDATASYNC=1
63-
#cgo CFLAGS: -DHAVE_PREAD=1 -DHAVE_PWRITE=1
64-
#cgo CFLAGS: -DHAVE_USLEEP=1
65-
66-
#cgo LDFLAGS: -lm
62+
#cgo linux LDFLAGS: -lm
63+
#cgo openbsd LDFLAGS: -lm
64+
#cgo linux,!android CFLAGS: -DHAVE_FDATASYNC=1
65+
#cgo linux,!android CFLAGS: -DHAVE_PREAD=1 -DHAVE_PWRITE=1
66+
#cgo darwin CFLAGS: -DHAVE_FDATASYNC=1
67+
#cgo darwin CFLAGS: -DHAVE_PREAD=1 -DHAVE_PWRITE=1
68+
#cgo windows LDFLAGS: -Wl,-Bstatic -lwinpthread -Wl,-Bdynamic
69+
70+
// Fix for BusyTimeout on *nix systems.
71+
#cgo !windows CFLAGS: -DHAVE_USLEEP=1
72+
73+
// Fix "_localtime32(0): not defined" linker error.
74+
#cgo windows,386 CFLAGS: -D_localtime32=localtime
6775
6876
#include "sqlite3.h"
6977

0 commit comments

Comments
 (0)