Skip to content

Commit 603497f

Browse files
committed
go: Statically link possum on linux
1 parent 0879105 commit 603497f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

go/cpossum/c-possum.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
package possumC
22

33
/*
4-
#cgo LDFLAGS: -L${SRCDIR}/../../target/debug -lpossum
4+
// I think we trigger static linking on Linux because we don't want to have to specify the path to
5+
// the library at runtime. I can't seem to get CGO on macOS to do the same.
6+
#cgo !darwin LDFLAGS: -L${SRCDIR}/../../target/debug -l:libpossum.a -lm
7+
#cgo darwin LDFLAGS: -L${SRCDIR}/../../target/debug -lpossum
58
#include "possum.h"
69
*/
710
import "C"

0 commit comments

Comments
 (0)