-
Notifications
You must be signed in to change notification settings - Fork 9
/
binding.gyp
99 lines (99 loc) · 3.77 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
{
'targets': [
{
'target_name': 'gles2',
'defines': [
'VERSION=0.0.1'
],
'variables': {
'platform': '<(OS)',
'has_glfw': '<!(pkg-config glfw3 --libs --silence-errors | grep glfw || true)',
'has_nexus': '<!(pkg-config glesv2 egl --libs --silence-errors | grep nexus || true)',
'has_bcm': '<!(pkg-config glesv2 egl --libs --silence-errors | grep bcm || true)',
'has_raspbian': '<!(PKG_CONFIG_PATH=/opt/vc/lib/pkgconfig/ pkg-config brcmglesv2 brcmegl --libs --silence-errors | grep bcm || true)'
},
'include_dirs': [
"<!(node -e \"require('nan')\")",
'<(module_root_dir)/deps/include',
'/opt/vc/include'
],
'conditions': [
['OS=="linux" and has_glfw!=""', {
'sources': [
'src/glew/gles2glewimpl.cc',
'src/bindings.cc',
'src/gles2platform.cc',
'src/interface/webgl.cc'
],
'libraries': ['<!@(pkg-config --libs glfw3 glew xcursor xrandr x11 xinerama)'],
'defines': ['IS_GLEW']
}],
['OS=="linux" and has_glfw=="" and has_nexus!=""', {
'sources': [
'src/nexus/Nexus.cc',
'src/nexus/gles2nexusimpl.cc',
'src/bindings.cc',
'src/gles2platform.cc',
'src/interface/webgl.cc'
],
'libraries': ['<!@(pkg-config --libs egl glesv2)'],
'include_dirs': [ '<!@(pkg-config egl glesv2 --cflags-only-I | sed s/-I//g)' ],
'cflags': [ '-fPIC -std=c++11' ],
'defines': [ 'BCM_NEXUS_NXCLIENT' ]
}],
['OS=="linux" and has_glfw=="" and has_nexus=="" and has_bcm!=""', {
'sources': [
'src/rpi/gles2rpiimpl.cc',
'src/bindings.cc',
'src/gles2platform.cc',
'src/interface/webgl.cc'
],
'libraries': ['<!@(pkg-config --libs egl glesv2)'],
'include_dirs': [ '<!@(pkg-config egl glesv2 --cflags-only-I | sed s/-I//g)']
}],
['OS=="linux" and has_glfw=="" and has_nexus=="" and has_raspbian!=""', {
'sources': [
'src/rpi/gles2rpiimpl.cc',
'src/bindings.cc',
'src/gles2platform.cc',
'src/interface/webgl.cc'
],
'libraries': ['<!@(PKG_CONFIG_PATH=/opt/vc/lib/pkgconfig pkg-config --libs brcmegl brcmglesv2)'],
'include_dirs': [ '<!@(PKG_CONFIG_PATH=/opt/vc/lib/pkgconfig pkg-config brcmegl brcmglesv2 --cflags-only-I | sed s/-I//g)']
}],
['OS=="mac"', {
'sources': [
'src/glew/gles2glewimpl.cc',
'src/bindings.cc',
'src/gles2platform.cc',
'src/interface/webgl.cc'
],
'include_dirs': [ '<!@(pkg-config glfw3 glew --cflags-only-I | sed s/-I//g)'],
'libraries': [ '<!@(pkg-config --libs glfw3 glew)', '-framework OpenGL'],
'library_dirs': ['/usr/local/lib'],
'defines': ['IS_GLEW']
}],
['OS=="win"', {
'sources': [
'src/glew/gles2glewimpl.cc',
'src/bindings.cc',
'src/gles2platform.cc',
'src/interface/webgl.cc'
],
'include_dirs': ['<(module_root_dir)/deps/include'],
'library_dirs': ['<(module_root_dir)/deps/windows/lib/<(target_arch)'],
'libraries': ['glew32.lib','opengl32.lib'],
'defines' : ['IS_GLEW','WIN32_LEAN_AND_MEAN','VC_EXTRALEAN'],
'msvs_settings' : {
'VCCLCompilerTool' : {
'AdditionalOptions' : ['/O2','/Oy','/GL','/GF','/Gm-','/EHsc','/MT','/GS','/Gy','/GR-','/Gd']
},
'VCLinkerTool' : {
'AdditionalOptions' : ['/OPT:REF','/OPT:ICF','/LTCG']
},
}
}]
]
}
]
}