forked from LedgerHQ/lib-ledger-core-node-bindings
-
Notifications
You must be signed in to change notification settings - Fork 0
/
binding.gyp
85 lines (85 loc) · 2.45 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
{
'variables': {
'core_library%': 'lib',
'source_path%': 'src',
'conditions': [
['OS=="win"', { 'lib_name': 'ledger-core' }],
['OS!="win"', { 'lib_name': 'libledger-core' }],
]
},
'targets': [{
'target_name': 'ledger-core-node',
'sources': ["<!@(python glob.py <@(source_path) *.cpp *.hpp)"],
'include_dirs': [
"<!(node -e \"require('nan')\")",
"<(module_root_dir)/include",
],
'all_dependent_settings': {
'include_dirs': ["<!(node -e \"require('nan')\")"],
},
"copies": [
{
'files': [ '<(module_root_dir)/<(core_library)/<(lib_name)<(SHARED_LIB_SUFFIX)' ],
'destination': '<(module_root_dir)/build/Release/',
},
],
'conditions': [
['OS=="mac"', {
'LDFLAGS': [
'-framework IOKit',
'-framework CoreFoundation',
'-DYLD_LIBRARY_PATH '
],
'libraries': [
'-L<(module_root_dir)/<@(core_library)',
'-lledger-core'
],
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'OTHER_CFLAGS': [
'-ObjC++',
'-std=c++14',
],
'OTHER_LDFLAGS': [
'-framework IOKit',
'-framework CoreFoundation',
'-Xlinker -rpath -Xlinker @loader_path/'
],
},
}],
['OS=="win"', {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'OTHER_CFLAGS': ['-std=c++14'],
"copies": [
{
'files': [ '<(module_root_dir)/<(core_library)/<(lib_name)<(SHARED_LIB_SUFFIX)' ],
'destination': '<(module_root_dir)/build/Release/',
},
{
'files': [ '<(module_root_dir)/<(core_library)/crypto<(SHARED_LIB_SUFFIX)' ],
'destination': '<(module_root_dir)/build/Release/',
},
{
'files': [ '<(module_root_dir)/<(core_library)/<(lib_name).lib' ],
'destination': '<(module_root_dir)/build/',
},
],
'include_dirs': ['$(UCRT_BASED_PATH)'],
'libraries': ['ledger-core'],
}],
['OS=="linux"', {
'ldflags': [
'-Wl,-R,\'$$ORIGIN\'',
],
'libraries': [
'-L<(module_root_dir)/<@(core_library)',
'-lledger-core',
],
}],
],
'cflags!': ['-ansi', '-fno-exceptions'],
'cflags_cc!': ['-fno-exceptions'],
'cflags': ['-g', '-exceptions'],
'cflags_cc': ['-g', '-exceptions']
}]
}