Skip to content
This repository has been archived by the owner on Dec 23, 2024. It is now read-only.

Commit

Permalink
build: use relative paths to tfhe-rs
Browse files Browse the repository at this point in the history
Use relative paths to tfhe-rs instead of environment variables.
  • Loading branch information
dartdart26 committed Oct 13, 2023
1 parent c038c4b commit 45fd69c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
TFHE_RS_FOLDER=${ROOT_DIR}/tfhe-rs/
CGO_CFLAGS="-I${TFHE_RS_FOLDER}/target/release/"
CGO_LDFLAGS="-L${TFHE_RS_FOLDER}/target/release/"

.PHONY: build
build: build-tfhe-rs-capi
cd fhevm && CGO_CFLAGS=${CGO_CFLAGS} CGO_LDFLAGS=${CGO_LDFLAGS} go build .
cd fhevm && go build .

.PHONY: test
test: build-tfhe-rs-capi
cd fhevm && CGO_CFLAGS=${CGO_CFLAGS} 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

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

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

0 comments on commit 45fd69c

Please sign in to comment.