-
Notifications
You must be signed in to change notification settings - Fork 88
/
binding.gyp
131 lines (129 loc) · 3.74 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
{
'variables': {
'compiler-flags': [],
'scrypt_platform_specific_files': [],
'scrypt_platform_specific_includes': [],
'conditions': [
['OS=="win"', {
'scrypt_platform_specific_files': [
'scrypt/win/mman.c',
'scrypt/win/gettimeofday.c'
],
'scrypt_platform_specific_includes': [
'scrypt/win/include',
],
}],
['OS!="win"',{
'compiler-flags': ['-std=c++11']
}],
['OS=="mac"', {
'xcode_settings': {
'OTHER_CPLUSPLUSFLAGS' : ['-stdlib=libc++'],
},
}],
],
},
'target_defaults': {
'default_configuration': 'Release',
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 0, # static release
'ExceptionHandling': '2',
'AdditionalOptions': ['/EHsc'],
'DisableSpecificWarnings': ['4506'],
},
},
},
'targets': [
{
'target_name': 'copied_files',
'conditions': [
['OS=="win"', {
'copies' : [{
'destination':'scrypt/scrypt-1.2.0/',
'files' : [
'scrypt/win/include/config.h'
]
}],
}]
]
},
{
'target_name': 'scrypt_lib',
'type' : 'static_library',
'sources': [
'scrypt/scrypt-1.2.0/lib/crypto/crypto_scrypt.c',
'scrypt/scrypt-1.2.0/lib/crypto/crypto_scrypt_smix.c',
'scrypt/scrypt-1.2.0/libcperciva/util/warnp.c',
'scrypt/scrypt-1.2.0/libcperciva/alg/sha256.c',
'scrypt/scrypt-1.2.0/libcperciva/util/insecure_memzero.c',
'scrypt/scrypt-1.2.0/lib/scryptenc/scryptenc_cpuperf.c',
'<@(scrypt_platform_specific_files)',
],
'include_dirs': [
'scrypt/scrypt-1.2.0/',
'scrypt/scrypt-1.2.0/libcperciva/cpusupport',
'scrypt/scrypt-1.2.0/libcperciva/alg',
'scrypt/scrypt-1.2.0/libcperciva/util',
'scrypt/scrypt-1.2.0/lib/crypto',
'<@(scrypt_platform_specific_includes)',
],
'defines': [
'HAVE_CONFIG_H'
],
'conditions': [
['OS=="win"', { 'defines' : [ 'inline=__inline' ] }],
],
'dependencies': ['copied_files'],
},
{
'target_name': 'scrypt_wrapper',
'type' : 'static_library',
'sources': [
'src/util/memlimit.c',
'src/scryptwrapper/keyderivation.c',
'src/scryptwrapper/pickparams.c',
'src/scryptwrapper/hash.c'
],
'include_dirs': [
'src/scryptwrapper/inc',
'src',
'scrypt/scrypt-1.2.0/libcperciva/alg',
'scrypt/scrypt-1.2.0/libcperciva/util',
'scrypt/scrypt-1.2.0/lib/crypto',
'scrypt/scrypt-1.2.0/lib/util/',
'scrypt/scrypt-1.2.0/lib/scryptenc/',
'<@(scrypt_platform_specific_includes)',
],
'defines': [
'HAVE_CONFIG_H'
],
'conditions': [
['OS=="win"', { 'defines' : [ 'inline=__inline' ] }],
],
},
{
'target_name': 'scrypt',
'sources': [
'src/node-boilerplate/scrypt_common.cc',
'src/node-boilerplate/scrypt_params_async.cc',
'src/node-boilerplate/scrypt_params_sync.cc',
'src/node-boilerplate/scrypt_kdf_async.cc',
'src/node-boilerplate/scrypt_kdf_sync.cc',
'src/node-boilerplate/scrypt_kdf-verify_sync.cc',
'src/node-boilerplate/scrypt_kdf-verify_async.cc',
'src/node-boilerplate/scrypt_hash_sync.cc',
'src/node-boilerplate/scrypt_hash_async.cc',
'scrypt_node.cc'
],
'include_dirs': [
'<!(node -e "require(\'nan\')")',
'src/util',
'src/scryptwrapper/inc',
'src/node-boilerplate/inc'
],
'cflags': ['<@(compiler-flags)'],
'dependencies': ['scrypt_wrapper','scrypt_lib'],
}
],
}