generated from devzolo/nodejs-addon-api-project-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbinding.gyp
204 lines (199 loc) · 8.7 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
{
'variables': {
'platform': '<(OS)',
'build_arch': '<!(node -p "process.arch")',
'build_win_platform': '<!(node -p "process.arch==\'ia32\'?\'Win32\':process.arch")',
},
'conditions': [
# Replace gyp platform with node platform, blech
['platform == "mac"', {'variables': {'platform': 'darwin'}}],
['platform == "win"', {'variables': {'platform': 'win32'}}],
],
'targets': [
{
'target_name': 'native-glut',
"cflags!": [
"-fno-exceptions",
"-Wall",
"-Wextra",
"-Wpointer-arith",
"-Wvla",
"-Wwrite-strings",
"-Wno-error=extra",
"-Wno-error=unused-function",
"-Wno-error=sign-compare",
"-Wno-error=strict-aliasing",
"-Wno-error=type-limits",
"-Wno-error=unused-parameter",
"-Wno-error=unused-variable",
"-Wno-error=undef",
"-Wno-error=uninitialized",
"-Wno-error=unused-result",
"-Wlogical-op",
"-Wno-error=maybe-uninitialized",
"-Wno-error=clobbered",
"-Wno-error=unused-but-set-variable",
"-Waggregate-return",
"-Wnested-externs",
"-Wold-style-definition",
"-Wstrict-prototypes",
"-fno-common",
"-fno-exceptions"
],
"cflags_cc!": [
"-fno-exceptions",
"-Wall",
"-Wextra",
"-Wpointer-arith",
"-Wvla",
"-Wwrite-strings",
"-Wno-error=extra",
"-Wno-error=unused-function",
"-Wno-error=sign-compare",
"-Wno-error=strict-aliasing",
"-Wno-error=type-limits",
"-Wno-error=unused-parameter",
"-Wno-error=unused-variable",
"-Wno-error=undef",
"-Wno-error=uninitialized",
"-Wno-error=unused-result",
"-Wlogical-op",
"-Wno-error=maybe-uninitialized",
"-Wno-error=clobbered",
"-Wno-error=unused-but-set-variable",
"-Waggregate-return",
"-Wnested-externs",
"-Wold-style-definition",
"-Wstrict-prototypes",
"-fno-common",
"-fno-exceptions"
],
'sources': [
"src/common.h",
"src/framework.h",
"GL/freeglut.h",
"GL/freeglut_ucall.h",
"GL/freeglut_ext.h",
"GL/freeglut_std.h",
"deps/freeglut-3.2.1/src/fg_callbacks.c",
"deps/freeglut-3.2.1/src/fg_cursor.c",
"deps/freeglut-3.2.1/src/fg_display.c",
"deps/freeglut-3.2.1/src/fg_ext.c",
"deps/freeglut-3.2.1/src/fg_font_data.c",
"deps/freeglut-3.2.1/src/fg_gamemode.c",
"deps/freeglut-3.2.1/src/fg_geometry.c",
"deps/freeglut-3.2.1/src/fg_gl2.c",
"deps/freeglut-3.2.1/src/fg_gl2.h",
"deps/freeglut-3.2.1/src/fg_init.c",
"deps/freeglut-3.2.1/src/fg_init.h",
"deps/freeglut-3.2.1/src/fg_internal.h",
"deps/freeglut-3.2.1/src/fg_callback_macros.h",
"deps/freeglut-3.2.1/src/fg_input_devices.c",
"deps/freeglut-3.2.1/src/fg_joystick.c",
"deps/freeglut-3.2.1/src/fg_main.c",
"deps/freeglut-3.2.1/src/fg_misc.c",
"deps/freeglut-3.2.1/src/fg_overlay.c",
"deps/freeglut-3.2.1/src/fg_spaceball.c",
"deps/freeglut-3.2.1/src/fg_state.c",
"deps/freeglut-3.2.1/src/fg_stroke_mono_roman.c",
"deps/freeglut-3.2.1/src/fg_stroke_roman.c",
"deps/freeglut-3.2.1/src/fg_structure.c",
"deps/freeglut-3.2.1/src/fg_teapot.c",
"deps/freeglut-3.2.1/src/fg_teapot_data.h",
"deps/freeglut-3.2.1/src/fg_videoresize.c",
"deps/freeglut-3.2.1/src/fg_window.c",
"deps/freeglut-3.2.1/src/fg_font.c",
"deps/freeglut-3.2.1/src/fg_menu.c",
"deps/freeglut-3.2.1/src/util/xparsegeometry_repl.h",
"deps/freeglut-3.2.1/src/util/xparsegeometry_repl.c",
"src/glut_ext.c",
"src/glut.cc",
],
'defines': ['NAPI_DISABLE_CPP_EXCEPTIONS', 'FREEGLUT_EXPORTS', 'FREEGLUT_PRINT_ERRORS', '_WIN32_WINNT=0x0501'],
'libraries': [],
"conditions":[
["OS=='win'", {
'libraries': ['opengl32'],
"sources": [
"deps/freeglut-3.2.1/src/mswin/fg_cursor_mswin.c",
"deps/freeglut-3.2.1/src/mswin/fg_display_mswin.c",
"deps/freeglut-3.2.1/src/mswin/fg_ext_mswin.c",
"deps/freeglut-3.2.1/src/mswin/fg_gamemode_mswin.c",
"deps/freeglut-3.2.1/src/mswin/fg_init_mswin.c",
"deps/freeglut-3.2.1/src/mswin/fg_internal_mswin.h",
"deps/freeglut-3.2.1/src/mswin/fg_input_devices_mswin.c",
"deps/freeglut-3.2.1/src/mswin/fg_joystick_mswin.c",
"deps/freeglut-3.2.1/src/mswin/fg_main_mswin.c",
"deps/freeglut-3.2.1/src/mswin/fg_menu_mswin.c",
"deps/freeglut-3.2.1/src/mswin/fg_spaceball_mswin.c",
"deps/freeglut-3.2.1/src/mswin/fg_state_mswin.c",
"deps/freeglut-3.2.1/src/mswin/fg_structure_mswin.c",
"deps/freeglut-3.2.1/src/mswin/fg_window_mswin.c",
],
}],
["OS=='linux'", {
'defines': ['INT_MAX=0x7fffffff'],
'libraries': [],
"sources": [
"deps/freeglut-3.2.1/src/x11/fg_cursor_x11.c",
"deps/freeglut-3.2.1/src/x11/fg_display_x11_glx.c",
"deps/freeglut-3.2.1/src/x11/fg_ext_x11.c",
"deps/freeglut-3.2.1/src/x11/fg_gamemode_x11.c",
"deps/freeglut-3.2.1/src/x11/fg_glutfont_definitions_x11.c",
"deps/freeglut-3.2.1/src/x11/fg_init_x11.c",
"deps/freeglut-3.2.1/src/x11/fg_input_devices_x11.c",
"deps/freeglut-3.2.1/src/x11/fg_internal_x11.h",
"deps/freeglut-3.2.1/src/x11/fg_joystick_x11.c",
"deps/freeglut-3.2.1/src/x11/fg_main_x11.c",
"deps/freeglut-3.2.1/src/x11/fg_menu_x11.c",
"deps/freeglut-3.2.1/src/x11/fg_spaceball_x11.c",
"deps/freeglut-3.2.1/src/x11/fg_state_x11.c",
"deps/freeglut-3.2.1/src/x11/fg_state_x11_glx.c",
"deps/freeglut-3.2.1/src/x11/fg_structure_x11.c",
"deps/freeglut-3.2.1/src/x11/fg_window_x11.c",
"deps/freeglut-3.2.1/src/x11/fg_window_x11_glx.c",
"deps/freeglut-3.2.1/src/x11/fg_xinput_x11.c",
]
}],
["OS=='mac'", {
"sources": []
}]
],
"include_dirs": [
"./deps/freeglut-3.2.1/include",
"./deps/freeglut-3.2.1/src",
"<!@(node -p \"require('node-addon-api').include\")"
],
'library_dirs': [],
'msvs_disabled_warnings': [4101, 4293, 4018]
},
{
"target_name": "copy_dll",
"type": "none",
"dependencies": ["native-glut"],
"conditions": [
['OS=="win"', {
"copies":
[
{
'destination': '<(module_root_dir)/bin/<(platform)/<(target_arch)',
'files': [
'<(module_root_dir)/build/Release/native-glut.node',
]
}
]
}
]
],
"copies":
[
{
'destination': '<(module_root_dir)/dist',
'files': [
'<(module_root_dir)/src/types/index.d.ts',
]
}
]
}
]
}