From a7c28ebe833e88a961526c555de3dfb6624d4f94 Mon Sep 17 00:00:00 2001 From: Roman Volosatovs Date: Wed, 18 Sep 2024 11:49:30 +0200 Subject: [PATCH] fix: link `m` on Linux Signed-off-by: Roman Volosatovs --- build.go | 14 ++++++++------ build_dev.go | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/build.go b/build.go index 2f5c2da..ba97266 100644 --- a/build.go +++ b/build.go @@ -6,10 +6,12 @@ package west -// #cgo darwin,amd64 LDFLAGS: -L${SRCDIR}/lib/x86_64-darwin -lwest -// #cgo darwin,arm64 LDFLAGS: -L${SRCDIR}/lib/aarch64-darwin -lwest -// #cgo linux,amd64 LDFLAGS: -L${SRCDIR}/lib/x86_64-linux -lwest -// #cgo linux,arm64 LDFLAGS: -L${SRCDIR}/lib/aarch64-linux -lwest -// #cgo windows,amd64 LDFLAGS: -L${SRCDIR}/lib/x86_64-windows -lwest -// #cgo windows,arm64 LDFLAGS: -L${SRCDIR}/lib/aarch64-windows -lwest +// #cgo LDFLAGS: -lwest +// #cgo linux LDFLAGS: -lm +// #cgo darwin,amd64 LDFLAGS: -L${SRCDIR}/lib/x86_64-darwin +// #cgo darwin,arm64 LDFLAGS: -L${SRCDIR}/lib/aarch64-darwin +// #cgo linux,amd64 LDFLAGS: -L${SRCDIR}/lib/x86_64-linux +// #cgo linux,arm64 LDFLAGS: -L${SRCDIR}/lib/aarch64-linux +// #cgo windows,amd64 LDFLAGS: -L${SRCDIR}/lib/x86_64-windows +// #cgo windows,arm64 LDFLAGS: -L${SRCDIR}/lib/aarch64-windows import "C" diff --git a/build_dev.go b/build_dev.go index 44032ae..e7b2292 100644 --- a/build_dev.go +++ b/build_dev.go @@ -7,4 +7,5 @@ package west // #cgo LDFLAGS: -L${SRCDIR}/target/debug -lwest_sys +// #cgo linux LDFLAGS: -lm import "C"