-
-
Notifications
You must be signed in to change notification settings - Fork 94
/
binding.gyp
85 lines (85 loc) · 2.54 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
{
"target_defaults": {
"include_dirs": ["argon2/include"],
"target_conditions": [
["OS == 'mac'", {
"xcode_settings": {
"CLANG_CXX_LIBRARY": "libc++",
"GCC_ENABLE_CPP_EXCEPTIONS": "YES",
"MACOSX_DEPLOYMENT_TARGET": "10.7"
}
}],
["OS == 'win'", {
"defines+": ["_HAS_EXCEPTIONS=1"],
"msvs_settings": {
"VCCLCompilerTool": { "ExceptionHandling": 1 }
}
}]
],
"configurations": {
"Release": {
"target_conditions": [
["OS not in 'ios mac'", {
# Avoid defining _FORTIFY_SOURCE on Darwin
"defines+": ["_FORTIFY_SOURCE=2"]
}],
["OS not in 'win ios mac aix'", {
# On Darwin with Xcode CLT/LLVM, "-fvisibility=hidden" hide all symbols that
# not explicitly marked with __attribute__((visibility("default")))
# Flags for sections are specific to ELF binaries
"cflags+": ["-fdata-sections", "-ffunction-sections", "-fvisibility=hidden"],
"ldflags+": ["-Wl,--gc-sections"]
}]
],
"defines+": ["NDEBUG"]
}
}
},
"targets": [
{
"target_name": "libargon2",
"sources": [
"argon2/src/argon2.c",
"argon2/src/blake2/blake2b.c",
"argon2/src/core.c",
"argon2/src/encoding.c",
"argon2/src/thread.c"
],
"cflags+": ["-Wno-type-limits"],
"conditions": [
["target_arch == 'ia32' or target_arch == 'x64'", {
"cflags+": ["-msse", "-msse2"],
"sources+": ["argon2/src/opt.c"]
}, {
"sources+": ["argon2/src/ref.c"]
}]
],
"type": "static_library"
}, {
"target_name": "argon2",
"defines+": [
"NAPI_VERSION=<(napi_build_version)",
"NODE_ADDON_API_DISABLE_DEPRECATED",
"NODE_API_NO_EXTERNAL_BUFFERS_ALLOWED"
],
"sources": [
"argon2.cpp"
],
"cflags_cc+": ["-Wall", "-Wextra", "-Wformat", "-Wnon-virtual-dtor", "-pedantic", "-Werror", "-fexceptions"],
"cflags_cc!": ["-fno-exceptions"],
"include_dirs": ["<!(node -p \"require('node-addon-api').include_dir\")"],
"dependencies": ["libargon2"],
"configurations": {
"Debug": {
"conditions": [
["OS == 'linux'", {
"cflags": ["--coverage"],
"ldflags": ["-fprofile-arcs", "-ftest-coverage"]
}]
],
"defines+": ["NODE_ADDON_API_ENABLE_TYPE_CHECK_ON_AS"]
}
}
}
]
}