mirror of
https://github.com/logos-messaging/go-rln.git
synced 2026-01-02 13:03:07 +00:00
chore: use single file for linkage
This commit is contained in:
parent
c58534eb3b
commit
7d5fb6db12
4
Makefile
4
Makefile
@ -1,4 +1,4 @@
|
|||||||
.PHONY: rlnlib
|
.PHONY: rlnlib-cross
|
||||||
|
|
||||||
SHELL := bash # the shell used internally by Make
|
SHELL := bash # the shell used internally by Make
|
||||||
|
|
||||||
@ -13,4 +13,4 @@ rlnlib:
|
|||||||
cd lib/rln && cbindgen --config ../cbindgen.toml --crate rln --output ../../rln/librln.h --lang c
|
cd lib/rln && cbindgen --config ../cbindgen.toml --crate rln --output ../../rln/librln.h --lang c
|
||||||
|
|
||||||
test:
|
test:
|
||||||
LD_LIBRARY_PATH="${PWD}/libs/x86_64-unknown-linux-gnu/" go test ./... -count 1 -v
|
go test ./... -count 1 -v
|
||||||
26
rln/link.go
Normal file
26
rln/link.go
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
package rln
|
||||||
|
|
||||||
|
/*
|
||||||
|
#cgo LDFLAGS:-lrln -ldl -lm
|
||||||
|
#cgo android,arm64 LDFLAGS:-L${SRCDIR}/../libs/aarch64-linux-android
|
||||||
|
#cgo android,arm7 LDFLAGS:-L${SRCDIR}/../libs/armv7-linux-androideabi
|
||||||
|
#cgo android,amd64 LDFLAGS:-L${SRCDIR}/../libs/x86_64-linux-android
|
||||||
|
#cgo android,386 LDFLAGS:-L${SRCDIR}/../libs/i686-linux-android
|
||||||
|
#cgo linux,arm,!arm7 LDFLAGS:-L${SRCDIR}/../libs/arm-unknown-linux-gnueabi
|
||||||
|
#cgo linux,arm7 LDFLAGS:-L${SRCDIR}/../libs/arm-unknown-linux-gnueabihf
|
||||||
|
#cgo linux,arm64 LDFLAGS:-L${SRCDIR}/../libs/aarch64-unknown-linux-gnu
|
||||||
|
#cgo linux,amd64,musl,!android LDFLAGS:-L${SRCDIR}/../libs/x86_64-unknown-linux-musl
|
||||||
|
#cgo linux,amd64,!musl,!android LDFLAGS:-L${SRCDIR}/../libs/x86_64-unknown-linux-gnu
|
||||||
|
#cgo linux,386 LDFLAGS:-L${SRCDIR}/../libs/i686-unknown-linux-gnu
|
||||||
|
#cgo linux,mips LDFLAGS:-L${SRCDIR}/../libs/mips-unknown-linux-gnu
|
||||||
|
#cgo linux,mips64 LDFLAGS:-L${SRCDIR}/../libs/mips64-unknown-linux-gnuabi64
|
||||||
|
#cgo linux,mips64le LDFLAGS:-L${SRCDIR}/../libs/mips64el-unknown-linux-gnuabi64
|
||||||
|
#cgo linux,mipsle LDFLAGS:-L${SRCDIR}/../libs/mipsel-unknown-linux-gnu
|
||||||
|
#cgo windows,386 LDFLAGS:-L${SRCDIR}/../libs/i686-pc-windows-gnu -lrln -lm -lws2_32 -luserenv
|
||||||
|
#cgo windows,amd64 LDFLAGS:-L${SRCDIR}/../libs/x86_64-pc-windows-gnu -lrln -lm -lws2_32 -luserenv
|
||||||
|
#cgo darwin,386,!ios LDFLAGS:-L${SRCDIR}/../libs/i686-apple-darwin
|
||||||
|
#cgo darwin,arm64,!ios LDFLAGS:-L${SRCDIR}/../libs/aarch64-apple-darwin
|
||||||
|
#cgo darwin,amd64,!ios LDFLAGS:-L${SRCDIR}/../libs/x86_64-apple-darwin
|
||||||
|
#cgo ios LDFLAGS:-L${SRCDIR}/../libs/universal -framework Security -framework Foundation
|
||||||
|
*/
|
||||||
|
import "C"
|
||||||
@ -1,8 +0,0 @@
|
|||||||
// +build android
|
|
||||||
|
|
||||||
package rln
|
|
||||||
|
|
||||||
/*
|
|
||||||
#cgo LDFLAGS: -L${SRCDIR}/../libs/aarch64-linux-android -L${SRCDIR}/../libs/armv7-linux-androideabi -L${SRCDIR}/../libs/i686-linux-android -L${SRCDIR}/../libs/x86_64-linux-android -lrln -ldl -lm
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
// +build linux,arm,!arm7
|
|
||||||
|
|
||||||
package rln
|
|
||||||
|
|
||||||
/*
|
|
||||||
#cgo LDFLAGS: -L${SRCDIR}/../libs/arm-unknown-linux-gnueabi -lrln -ldl -lm
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
// +build linux,arm64
|
|
||||||
|
|
||||||
package rln
|
|
||||||
|
|
||||||
/*
|
|
||||||
#cgo LDFLAGS: -L${SRCDIR}/../libs/aarch64-unknown-linux-gnu -lrln -ldl -lm
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
// +build arm7
|
|
||||||
|
|
||||||
package rln
|
|
||||||
|
|
||||||
/*
|
|
||||||
#cgo LDFLAGS: -L${SRCDIR}/../libs/arm-unknown-linux-gnueabihf -lrln -ldl -lm
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
// +build darwin,386,!ios
|
|
||||||
|
|
||||||
package rln
|
|
||||||
|
|
||||||
/*
|
|
||||||
#cgo LDFLAGS: -L${SRCDIR}/../libs/i686-apple-darwin -lrln -ldl -lm
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
// +build darwin,amd64,!ios
|
|
||||||
|
|
||||||
package rln
|
|
||||||
|
|
||||||
/*
|
|
||||||
#cgo LDFLAGS: -L${SRCDIR}/../libs/x86_64-apple-darwin -lrln -ldl -lm
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
// +build darwin,arm64,!ios
|
|
||||||
|
|
||||||
package rln
|
|
||||||
|
|
||||||
/*
|
|
||||||
#cgo LDFLAGS: -L${SRCDIR}/../libs/aarch64-apple-darwin -lrln -ldl -lm
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
// +build ios
|
|
||||||
|
|
||||||
package rln
|
|
||||||
|
|
||||||
/*
|
|
||||||
#cgo LDFLAGS: -L${SRCDIR}/../libs/universal -lrln -ldl -lm -framework Security -framework Foundation
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
// +build !android,linux,386,!musl
|
|
||||||
|
|
||||||
package rln
|
|
||||||
|
|
||||||
/*
|
|
||||||
#cgo LDFLAGS: -L${SRCDIR}/../libs/i686-unknown-linux-gnu -lrln -ldl -lm -lpthread
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
//go:build !android && linux && amd64 && !musl
|
|
||||||
// +build !android,linux,amd64,!musl
|
|
||||||
|
|
||||||
package rln
|
|
||||||
|
|
||||||
/*
|
|
||||||
#cgo LDFLAGS: -L${SRCDIR}/../libs/x86_64-unknown-linux-gnu -lrln -ldl -lm -lpthread
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
// +build !android,musl
|
|
||||||
|
|
||||||
package rln
|
|
||||||
|
|
||||||
/*
|
|
||||||
#cgo LDFLAGS: -L${SRCDIR}/../libs/x86_64-unknown-linux-musl -lrln -ldl -lm
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
// +build linux,mips
|
|
||||||
|
|
||||||
package rln
|
|
||||||
|
|
||||||
/*
|
|
||||||
#cgo LDFLAGS: -L${SRCDIR}/../libs/mips-unknown-linux-gnu -lrln -ldl -lm
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
// +build linux,mips64
|
|
||||||
|
|
||||||
package rln
|
|
||||||
|
|
||||||
/*
|
|
||||||
#cgo LDFLAGS: -L${SRCDIR}/../libs/mips64-unknown-linux-gnuabi64 -lrln -ldl -lm
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
// +build linux,mips64le
|
|
||||||
|
|
||||||
package rln
|
|
||||||
|
|
||||||
/*
|
|
||||||
#cgo LDFLAGS: -L${SRCDIR}/../libs/mips64el-unknown-linux-gnuabi64 -lrln -ldl -lm
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
// +build linux,mipsle
|
|
||||||
|
|
||||||
package rln
|
|
||||||
|
|
||||||
/*
|
|
||||||
#cgo LDFLAGS: -L${SRCDIR}/../libs/mipsel-unknown-linux-gnu -lrln -ldl -lm
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
// +build windows,386
|
|
||||||
|
|
||||||
package rln
|
|
||||||
|
|
||||||
/*
|
|
||||||
#cgo LDFLAGS: -L${SRCDIR}/../libs/i686-pc-windows-gnu -lrln -lm -lws2_32 -luserenv
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
// +build windows,amd64
|
|
||||||
|
|
||||||
package rln
|
|
||||||
|
|
||||||
/*
|
|
||||||
#cgo LDFLAGS: -L${SRCDIR}/../libs/x86_64-pc-windows-gnu -lrln -lm -lws2_32 -luserenv
|
|
||||||
*/
|
|
||||||
import "C"
|
|
||||||
Loading…
x
Reference in New Issue
Block a user