Skip to content

Commit 485518d

Browse files
committed
[GYP] Storage library should only be built when the fallback-to-build happens
1 parent 30eca0d commit 485518d

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

binding.gyp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
{
22
"targets": [
3+
{
4+
"target_name": "action_before_build",
5+
"type": "none",
6+
"hard_dependency": 1,
7+
"actions": [
8+
{
9+
"action_name": "build rust-native-storage library",
10+
"inputs": [ "scripts/build_storage_lib.sh" ],
11+
"outputs": [ "" ],
12+
"action": ["scripts/build_storage_lib.sh"]
13+
}
14+
]
15+
},
316
{
417
"target_name": "<(module_name)",
18+
"dependencies": [ "action_before_build" ],
519
"cflags_cc": [ "-std=c++17" ],
620
"cflags!": [ "-fno-exceptions", "-fno-rtti" ],
721
"cflags_cc!": [ "-fno-exceptions", "-fno-rtti" ],

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ssvm-extensions",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"description": "Second State WebAssembly VM for Node.js Addon with all extensions",
55
"keywords": [
66
"wasm",
@@ -33,7 +33,7 @@
3333
"ssvmup": "^0.1.17"
3434
},
3535
"scripts": {
36-
"preinstall": "./preinstall.sh",
36+
"preinstall": "./scripts/preinstall.sh",
3737
"test": "cd ssvm-napi/test && ./test.sh",
3838
"install": "node-pre-gyp install --fallback-to-build"
3939
}

scripts/build_storage_lib.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
# Build SSVM-Storage dependencies
3+
cd ./rust_native_storage_library/
4+
make target/debug/librust_native_storage_library.so
5+
cd ../

preinstall.sh renamed to scripts/preinstall.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
#!/usr/bin/env bash
2-
# Build SSVM-Storage dependencies
3-
cd ./rust_native_storage_library/
4-
make target/debug/librust_native_storage_library.so
5-
cd ../
6-
72
# Check TensorFlow version
83
c++ ./utils/checker/tensorflow_version_checker.cc -ltensorflow -o ./tf_ver
94
./tf_ver
File renamed without changes.

0 commit comments

Comments
 (0)