gyp that maybe works on yarn install

This commit is contained in:
dancoffman 2022-11-05 00:28:36 -07:00
parent c033f782b8
commit d09b1009b6
No known key found for this signature in database
GPG Key ID: 47B1F53E36A9B3CC
5 changed files with 66 additions and 5 deletions

View File

@ -1,3 +1,4 @@
build
dist
*.node
node_modules

View File

@ -13,4 +13,4 @@ jest.config.js
rollup.config.js
tsconfig.json
babel.config.js
dist/blst/bindings
*.bak

View File

@ -26,4 +26,8 @@ bundle: clean
cp ../../src/c_kzg_4844.h dist/deps/c-kzg
publish:
mv binding.gyp binding.gyp.bak
mv binding.dist.gyp binding.gyp
npm publish
mv binding.gyp binding.dist.gyp
mv binding.gyp.bak binding.gyp

View File

@ -0,0 +1,60 @@
{
"targets": [
{
"target_name": "kzg",
"cflags!": ["-fno-exceptions"],
"cflags_cc!": ["-fno-exceptions"],
"xcode_settings": {
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
"CLANG_CXX_LIBRARY": "libc++",
"MACOSX_DEPLOYMENT_TARGET": "13.0"
},
"sources": ["kzg.cxx"],
"include_dirs": [
"../../inc",
"../../src",
"<!@(node -p \"require('node-addon-api').include\")"
],
"libraries": [
"<(module_root_dir)/libblst.a",
"<(module_root_dir)/c_kzg_4844.o"
],
"dependencies": ["<!(node -p \"require('node-addon-api').gyp\")"],
"defines": ["NAPI_DISABLE_CPP_EXCEPTIONS"],
"actions": [
{
"action_name": "build_blst",
"inputs": ["<(module_root_dir)/dist/deps/blst/build.sh"],
"outputs": ["<(module_root_dir)/libblst.a"],
"action": ["<(module_root_dir)/dist/deps/blst/build.sh"]
},
{
"action_name": "build_ckzg",
"inputs": [
"<(module_root_dir)/dist/deps/c-kzg/c_kzg_4844.c",
"<(module_root_dir)/libblst.a"
],
"outputs": ["<(module_root_dir)/c_kzg_4844.o"],
"action": [
"clang",
"-I<(module_root_dir)/dist/deps/blst/bindings",
"-O2",
"-c",
"<(module_root_dir)/dist/deps/c-kzg/c_kzg_4844.c"
]
}
]
},
{
"target_name": "action_after_build",
"type": "none",
"dependencies": ["kzg"],
"copies": [
{
"files": ["./build/Release/kzg.node"],
"destination": "./dist"
}
]
}
]
}

View File

@ -30,10 +30,6 @@
{
"files": ["./build/Release/kzg.node"],
"destination": "."
},
{
"files": ["./build/Release/kzg.node"],
"destination": "./dist"
}
]
}