Skip to content

Commit 8e1d5c1

Browse files
committed
Fix cgo directives for multiple constraints
1 parent 3cf78d4 commit 8e1d5c1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

go/cpossum/c-possum.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ package possumC
44
// I think we trigger static linking on Linux because we don't want to have to specify the path to
55
// the library at runtime. I can't seem to get CGO on macOS to do the same. I can't get a reliable
66
// Windows system to get to the point I can actually build this, so I don't know how it works there.
7-
#cgo !windows && !darwin LDFLAGS: -L${SRCDIR}/../../target/debug -l:libpossum.a -lm
8-
#cgo darwin || windows LDFLAGS: -L${SRCDIR}/../../target/debug -lpossum
7+
// Also cgo directives seem to use the old build constraint syntax. Why the fuck isn't this stuff
8+
// documented?
9+
#cgo !windows,!darwin LDFLAGS: -L${SRCDIR}/../../target/debug -l:libpossum.a -lm
10+
#cgo darwin windows LDFLAGS: -L${SRCDIR}/../../target/debug -lpossum
911
#include "possum.h"
1012
*/
1113
import "C"

0 commit comments

Comments
 (0)