forked from mapnik/node-mapnik
-
Notifications
You must be signed in to change notification settings - Fork 0
/
binding.gyp
143 lines (143 loc) · 4.39 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
132
133
134
135
136
137
138
139
140
141
142
143
{
'includes': [ 'common.gypi' ],
'variables': {
'ENABLE_GLIBC_WORKAROUND%':'false', # can be overriden by a command line variable because of the % sign
'enable_sse%':'true'
},
'targets': [
{
'target_name': '<(module_name)',
'product_dir': '<(module_path)',
'sources': [
"src/mapnik_logger.cpp",
"src/node_mapnik.cpp",
"src/blend.cpp",
"src/mapnik_map.cpp",
"src/mapnik_color.cpp",
"src/mapnik_geometry.cpp",
"src/mapnik_feature.cpp",
"src/mapnik_image.cpp",
"src/mapnik_image_view.cpp",
"src/mapnik_grid.cpp",
"src/mapnik_grid_view.cpp",
"src/mapnik_memory_datasource.cpp",
"src/mapnik_palette.cpp",
"src/mapnik_projection.cpp",
"src/mapnik_layer.cpp",
"src/mapnik_datasource.cpp",
"src/mapnik_featureset.cpp",
"src/mapnik_expression.cpp",
"src/mapnik_cairo_surface.cpp",
"src/mapnik_vector_tile.cpp"
],
"msvs_disabled_warnings": [
4267
],
'include_dirs': [
'./mason_packages/.link/include/',
'./mason_packages/.link/include/freetype2',
'./mason_packages/.link/include/cairo',
'./src',
"<!(node -e \"require('nan')\")",
# TODO: move these to mason packages once we have a minimal windows client for mason (@springmeyer)
# https://github.com/mapbox/mason/issues/396
"./deps/geometry/include/",
"./deps/wagyu/include/",
"<!(node -e \"require('protozero')\")",
"<!(node -e \"require('mapnik-vector-tile')\")"
],
'defines': [
'MAPNIK_GIT_REVISION="<!@(mapnik-config --git-describe)"',
],
'conditions': [
['ENABLE_GLIBC_WORKAROUND != "false"', {
'sources': [
"src/glibc_workaround.cpp"
]
}],
['OS=="win"',
{
'include_dirs':[
'<!@(mapnik-config --includes)',
'<!@(mapnik-config --dep-includes)'
],
'defines': ['NOMINMAX','<!@(mapnik-config --defines)'],
'defines!': ["_HAS_EXCEPTIONS=0"],
'libraries': [
'<!@(mapnik-config --libs)',
'mapnik-wkt.lib',
'mapnik-json.lib',
'<!@(mapnik-config --dep-libs)',
],
'msvs_disabled_warnings': [ 4244,4005,4506,4345,4804,4805 ],
'msvs_settings': {
'VCLinkerTool': {
'AdditionalLibraryDirectories': [
'<!@(mapnik-config --ldflags)'
],
},
}
},
{
'cflags_cc!': ['-fno-rtti', '-fno-exceptions'],
'cflags_cc' : [
'<!@(mapnik-config --cflags)',
],
'libraries':[
'<!@(mapnik-config --libs)',
'-lmapnik-wkt',
'-lmapnik-json',
'<!@(mapnik-config --ldflags)',
'<!@(mapnik-config --dep-libs)'
],
'ldflags': [
'-Wl,-z,now',
"-Wl,-z,origin",
"-Wl,-rpath=\$$ORIGIN/lib"
],
'xcode_settings': {
'OTHER_CPLUSPLUSFLAGS':[
'<!@(mapnik-config --cflags)',
],
'OTHER_CFLAGS':[
'<!@(mapnik-config --cflags)'
],
'OTHER_LDFLAGS':[
'-Wl,-bind_at_load'
],
'GCC_ENABLE_CPP_RTTI': 'YES',
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'MACOSX_DEPLOYMENT_TARGET':'10.8',
'CLANG_CXX_LIBRARY': 'libc++',
'CLANG_CXX_LANGUAGE_STANDARD':'c++11',
'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0'
}
},
],
['enable_sse == "true"', {
'defines' : [ 'SSE_MATH' ]
}]
]
},
{
'target_name': 'action_after_build',
'type': 'none',
'dependencies': [ '<(module_name)' ],
'hard_dependency': 1,
'conditions': [
['OS!="win"',
{
'actions': [
{
'action_name': 'postinstall',
'inputs': ['./scripts/postinstall.sh'],
'outputs': ['./lib/binding/mapnik'],
'action': ['./scripts/postinstall.sh']
}
]
}
]
]
},
]
}