Update bindings Makefiles with configurable blob size
This commit is contained in:
parent
c9274d8f43
commit
070948d68f
|
@ -1,5 +1,7 @@
|
|||
INCLUDE_DIRS = ../../src ../../blst/bindings
|
||||
|
||||
FIELD_ELEMENTS_PER_BLOB ?= 4096
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
BLST_BUILDSCRIPT=./build.bat
|
||||
BLST_OBJ=blst.lib
|
||||
|
@ -20,6 +22,8 @@ else
|
|||
CKZG_LIBRARY_PATH=Ckzg.Bindings/runtimes/$(CSHARP_PLATFORM)/native/ckzg.so
|
||||
endif
|
||||
|
||||
CLANG_FLAGS += -DFIELD_ELEMENTS_PER_BLOB=$(FIELD_ELEMENTS_PER_BLOB)
|
||||
|
||||
TARGETS=ckzg.c ../../src/c_kzg_4844.c ../../blst/$(BLST_OBJ)
|
||||
|
||||
.blst:
|
||||
|
|
|
@ -2,7 +2,9 @@ INCLUDE_DIRS = ../../src ../../blst/bindings
|
|||
|
||||
LIBRARY_FOLDER=src/main/resources/ethereum/ckzg4844/lib
|
||||
|
||||
CC_FLAGS=
|
||||
FIELD_ELEMENTS_PER_BLOB ?= 4096
|
||||
|
||||
CC_FLAGS = -DFIELD_ELEMENTS_PER_BLOB=$(FIELD_ELEMENTS_PER_BLOB)
|
||||
|
||||
ifeq ($(OS),Windows_NT)
|
||||
CLANG_EXECUTABLE=clang
|
||||
|
|
|
@ -8,7 +8,8 @@
|
|||
"CLANG_CXX_LIBRARY": "libc++",
|
||||
"MACOSX_DEPLOYMENT_TARGET": "13.0"
|
||||
},
|
||||
"defines": ["NAPI_DISABLE_CPP_EXCEPTIONS"],
|
||||
"defines": ["NAPI_DISABLE_CPP_EXCEPTIONS",
|
||||
"FIELD_ELEMENTS_PER_BLOB=<!(echo ${FIELD_ELEMENTS_PER_BLOB:-4096})"],
|
||||
"sources": ["kzg.cxx"],
|
||||
"include_dirs": [
|
||||
"../../inc",
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
INCLUDE_DIRS = .. ../../src ../../inc
|
||||
INCLUDE_PY = $(shell python -c 'import sysconfig; print(sysconfig.get_config_var("INCLUDEPY"))')
|
||||
|
||||
FIELD_ELEMENTS_PER_BLOB?=4096
|
||||
|
||||
.PHONY: all
|
||||
|
||||
all: test ecc_test
|
||||
|
@ -12,4 +14,4 @@ ecc_test: py_ecc_tests.py ckzg.so
|
|||
python $<
|
||||
|
||||
ckzg.so: ckzg.c ../../src/c_kzg_4844.o ../../lib/libblst.a
|
||||
clang -O -Wall -shared -fPIC -Wl,-Bsymbolic -I${INCLUDE_PY} ${addprefix -I,${INCLUDE_DIRS}} -o $@ $^
|
||||
clang -O -Wall -shared -fPIC -Wl,-Bsymbolic -I${INCLUDE_PY} ${addprefix -I,${INCLUDE_DIRS}} -DFIELD_ELEMENTS_PER_BLOB=${FIELD_ELEMENTS_PER_BLOB} -o $@ $^
|
||||
|
|
Loading…
Reference in New Issue