-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
binding.gyp
58 lines (58 loc) · 2.12 KB
/
binding.gyp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
"variables": {
"libzim_dir": "<(module_root_dir)/download",
"libzim_include": "<(module_root_dir)/download/include",
"libzim_local": "false", # change this to use system-installed libzim
},
"targets": [
{
"conditions": [
["libzim_local=='true' and OS=='linux'", {
"link_settings": {
"ldflags": [
"<!(pkg-config --libs-only-other --libs-only-L libzim)",
],
"libraries": [
"<!(pkg-config --libs-only-l libzim)",
],
},
}],
["libzim_local!='true' and OS=='linux'", {
"include_dirs": [
"<(libzim_include)",
],
"libraries": [
"-Wl,-rpath,'$$ORIGIN'",
"-L<(libzim_dir)/lib/x86_64-linux-gnu",
"<(libzim_dir)/lib/x86_64-linux-gnu/libzim.so.9",
],
}],
["libzim_local!='true' and OS=='mac'", {
"include_dirs": ["<(libzim_include)"],
"cflags+": ["-fvisibility=hidden"],
"xcode_settings": {
"GCC_SYMBOLS_PRIVATE_EXTERN": "YES", # -fvisibility=hidden
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
"LD_RUNPATH_SEARCH_PATHS": "@loader_path/",
"OTHER_CFLAGS": [ "-std=c++17", "-fexceptions" ],
},
"libraries": ["-Wl,-rpath,@loader_path/", "-L<(libzim_dir)/lib", "-lzim"],
}],
],
"target_name": "zim_binding",
"cflags!": [ "-fno-exceptions" ],
"cflags_cc!": [ "-fno-exceptions" ],
"cflags": [],
"cflags_cc": [ "-std=c++17", "-fexceptions" ],
"sources": [
"src/module.cc",
],
"include_dirs": [
"<!@(node -p \"require('node-addon-api').include\")",
],
"defines": [
"NAPI_CPP_EXCEPTIONS"
],
}
]
}