generated from devzolo/nodejs-addon-api-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbinding.gyp
More file actions
63 lines (63 loc) · 1.77 KB
/
binding.gyp
File metadata and controls
63 lines (63 loc) · 1.77 KB
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
{
'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-gl',
"cflags!": [ "-fno-exceptions" ],
"cflags_cc!": [ "-fno-exceptions" ],
'sources': [
'src/gl.cc'
],
'defines' : ['GLEW_STATIC','NAPI_DISABLE_CPP_EXCEPTIONS','GLEW_NO_GLU'],
"include_dirs": [
"<!@(node -p \"require('node-addon-api').include\")",
'<(module_root_dir)/deps/glew-2.1.0/include'
],
"conditions": [
['OS=="win"', {
'defines': ['UNICODE'],
'libraries': ['opengl32', 'glew32s'],
'conditions': [
['target_arch == "x64"', {
'library_dirs' : ['<(module_root_dir)/deps/glew-2.1.0/lib/Release/x64']
}]
]
}],
['OS=="linux"', {
'libraries': ['-lGL', '-lGLEW']
}],
['OS=="mac"', {
'libraries': ['-framework', 'OpenGL', '-lGLEW']
}]
]
},
{
"target_name": "copy_modules",
"type":"none",
"dependencies" : [ "native-gl" ],
"copies":[
{
'destination': '<(module_root_dir)/bin/<(platform)/<(target_arch)',
'files': [
'<(module_root_dir)/build/Release/native-gl.node',
]
},
{
'destination': '<(module_root_dir)/dist',
'files': [
'<(module_root_dir)/src/types/index.d.ts',
]
}
]
}
]
}