Skip to content

Commit d49783c

Browse files
committed
Fix macOS lib path with @loader_path
1 parent 2110d74 commit d49783c

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

binding.gyp

+16-12
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
{
2-
"variables": {
3-
"openssl_fips": "",
4-
},
52
"targets": [
63
{
74
"target_name": "chdb_node",
@@ -11,17 +8,24 @@
118
"."
129
],
1310
"libraries": [ "<(module_root_dir)/libchdb.so" ],
11+
"cflags!": [ "-fno-exceptions" ],
12+
"cflags_cc!": [ "-fno-exceptions" ],
13+
"defines": [ "NAPI_DISABLE_CPP_EXCEPTIONS" ],
1414
"conditions": [
15-
['OS=="mac"', {
16-
"ldflags": [
17-
"-Wl,-rpath,@loader_path/../../"
15+
["OS=='mac'", {
16+
"actions": [
17+
{
18+
"action_name": "postbuild",
19+
"inputs": [],
20+
"outputs": ["<(module_root_dir)/build/Release/postbuild_dummy"],
21+
"action": [
22+
"sh", "-c",
23+
"install_name_tool -change libchdb.so @loader_path/../../libchdb.so <(module_root_dir)/build/Release/chdb_node.node"
24+
]
25+
}
1826
]
1927
}]
20-
],
21-
"cflags!": [ "-fno-exceptions" ],
22-
"cflags_cc!": [ "-fno-exceptions" ],
23-
"defines": [ "NAPI_DISABLE_CPP_EXCEPTIONS" ]
28+
]
2429
}
2530
]
26-
}
27-
31+
}

0 commit comments

Comments
 (0)