forked from Project-OSRM/node-osrm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
binding.gyp
72 lines (72 loc) · 2.13 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
{
'includes': [ 'common.gypi' ],
'variables': {
'std%':'ansi',
"module_name":"<!(node -e \"console.log(require('./package.json').binary.module_name)\")",
"module_path":"<!(node -e \"console.log(require('./package.json').binary.module_path)\")",
},
'targets': [
{
'target_name': '<(module_name)',
'include_dirs': [
"<!(node -e \"require('nan')\")",
'<!@(pkg-config libosrm --variable=includedir)',
'./src/'
],
'libraries': [
'<!@(pkg-config libosrm --libs --static)'
],
'defines': ['LIBOSRM_GIT_REVISION="<!@(pkg-config libosrm --modversion)"'],
'conditions': [
[ 'OS=="linux"', {
# remove the older style c++11 flag
# inherited by node >= 4.x
'cflags_cc!' : [
'-std=gnu++0x'
],
'cflags_cc' : [
'-std=c++11',
'<!@(pkg-config libosrm --cflags)'
],
'libraries':[
'-Wl,-rpath=<!@(pkg-config libosrm --variable=libdir)',
'-lboost_program_options',
'-lboost_regex'
]}
],
['OS=="mac"', {
'xcode_settings': {
'CLANG_CXX_LIBRARY': 'libc++',
'CLANG_CXX_LANGUAGE_STANDARD':'c++11',
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
'MACOSX_DEPLOYMENT_TARGET':'10.8',
'OTHER_LDFLAGS':[
'-Wl,-bind_at_load'
]
}
}
]
],
'sources': [
"src/node_osrm.cpp"
],
'cflags_cc!': ['-fno-rtti', '-fno-exceptions'],
'xcode_settings': {
'OTHER_CPLUSPLUSFLAGS':['-Wno-unneeded-internal-declaration', '-Wno-unknown-pragmas', '<!@(pkg-config libosrm --cflags)'],
'GCC_ENABLE_CPP_RTTI': 'YES',
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES'
}
},
{
'target_name': 'action_after_build',
'type': 'none',
'dependencies': [ '<(module_name)' ],
'copies': [
{
'files': [ '<(PRODUCT_DIR)/<(module_name).node' ],
'destination': '<(module_path)'
}
]
}
]
}