Skip to content

Commit

Permalink
fix(build): use different flags per platform
Browse files Browse the repository at this point in the history
  • Loading branch information
youben11 committed Oct 20, 2023
1 parent 12086c6 commit 60412d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
11 changes: 3 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
ifeq ($(shell uname), Darwin)
CGO_LDFLAGS := -framework Security
endif

.PHONY: build
build: build-tfhe-rs-capi
cd fhevm && CGO_LDFLAGS='$(CGO_LDFLAGS)' go build .
cd fhevm && go build .

.PHONY: test
test: build-tfhe-rs-capi
cd fhevm && CGO_LDFLAGS='$(CGO_LDFLAGS)' go test -v .
cd fhevm && go test -v .

.PHONY: build-tfhe-rs-capi
build-tfhe-rs-capi:
cd tfhe-rs && make build_c_api_experimental_deterministic_fft \
&& cd target/release && rm -f *.dylib *.dll *.so
cd tfhe-rs && make build_c_api_experimental_deterministic_fft

.PHONY: clean
clean:
Expand Down
6 changes: 4 additions & 2 deletions fhevm/tfhe.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
package fhevm

/*
#cgo CFLAGS: -O3 -I../tfhe-rs/target/release
#cgo LDFLAGS: -L../tfhe-rs/target/release -ltfhe -lm
#cgo linux CFLAGS: -O3 -I../tfhe-rs/target/release
#cgo linux LDFLAGS: -L../tfhe-rs/target/release -l:libtfhe.a -lm
#cgo darwin CFLAGS: -O3 -I../tfhe-rs/target/release ../tfhe-rs/target/release/libtfhe.a
#cgo darwin LDFLAGS: -framework Security -lm
#include <tfhe.h>
Expand Down

0 comments on commit 60412d6

Please sign in to comment.