| 
1 | 1 | {  | 
2 |  | - 'conditions': [  | 
3 |  | - ['OS=="win"', {  | 
4 |  | - 'variables': {  | 
5 |  | - 'GTK_Root%': 'C:/GTK', # Set the location of GTK all-in-one bundle  | 
6 |  | - 'with_jpeg%': 'false',  | 
7 |  | - 'with_gif%': 'false',  | 
8 |  | - 'with_rsvg%': 'false',  | 
9 |  | - 'variables': { # Nest jpeg_root to evaluate it before with_jpeg  | 
10 |  | - 'jpeg_root%': '<!(node ./util/win_jpeg_lookup)'  | 
11 |  | - },  | 
12 |  | - 'jpeg_root%': '<(jpeg_root)', # Take value of nested variable  | 
13 |  | - 'conditions': [  | 
14 |  | - ['jpeg_root==""', {  | 
15 |  | - 'with_jpeg%': 'false'  | 
16 |  | - }, {  | 
17 |  | - 'with_jpeg%': 'true'  | 
18 |  | - }]  | 
19 |  | - ]  | 
20 |  | - }  | 
21 |  | - }, { # 'OS!="win"'  | 
22 |  | - 'variables': {  | 
23 |  | - 'with_jpeg%': '<!(node ./util/has_lib.js jpeg)',  | 
24 |  | - 'with_gif%': '<!(node ./util/has_lib.js gif)',  | 
25 |  | - 'with_rsvg%': '<!(node ./util/has_lib.js rsvg)'  | 
26 |  | - }  | 
27 |  | - }]  | 
28 |  | - ],  | 
29 | 2 |  'targets': [  | 
30 |  | - {  | 
31 |  | - 'target_name': 'canvas-postbuild',  | 
32 |  | - 'dependencies': ['canvas'],  | 
33 |  | - 'conditions': [  | 
34 |  | - ['OS=="win"', {  | 
35 |  | - 'copies': [{  | 
36 |  | - 'destination': '<(PRODUCT_DIR)',  | 
37 |  | - 'files': [  | 
38 |  | - '<(GTK_Root)/bin/zlib1.dll',  | 
39 |  | - '<(GTK_Root)/bin/libintl-8.dll',  | 
40 |  | - '<(GTK_Root)/bin/libpng14-14.dll',  | 
41 |  | - '<(GTK_Root)/bin/libpangocairo-1.0-0.dll',  | 
42 |  | - '<(GTK_Root)/bin/libpango-1.0-0.dll',  | 
43 |  | - '<(GTK_Root)/bin/libpangoft2-1.0-0.dll',  | 
44 |  | - '<(GTK_Root)/bin/libpangowin32-1.0-0.dll',  | 
45 |  | - '<(GTK_Root)/bin/libcairo-2.dll',  | 
46 |  | - '<(GTK_Root)/bin/libfontconfig-1.dll',  | 
47 |  | - '<(GTK_Root)/bin/libfreetype-6.dll',  | 
48 |  | - '<(GTK_Root)/bin/libglib-2.0-0.dll',  | 
49 |  | - '<(GTK_Root)/bin/libgobject-2.0-0.dll',  | 
50 |  | - '<(GTK_Root)/bin/libgmodule-2.0-0.dll',  | 
51 |  | - '<(GTK_Root)/bin/libgthread-2.0-0.dll',  | 
52 |  | - '<(GTK_Root)/bin/libexpat-1.dll'  | 
53 |  | - ]  | 
54 |  | - }]  | 
55 |  | - }]  | 
56 |  | - ]  | 
57 |  | - },  | 
58 | 3 |  {  | 
59 | 4 |  'target_name': 'canvas',  | 
60 |  | - 'include_dirs': ["<!(node -e \"require('nan')\")"],  | 
61 | 5 |  'sources': [  | 
62 | 6 |  'src/backend/Backend.cc',  | 
63 | 7 |  'src/backend/ImageBackend.cc',  | 
 | 
76 | 20 |  'src/init.cc',  | 
77 | 21 |  'src/register_font.cc'  | 
78 | 22 |  ],  | 
79 |  | - 'conditions': [  | 
80 |  | - ['OS=="win"', {  | 
81 |  | - 'libraries': [  | 
82 |  | - '-l<(GTK_Root)/lib/cairo.lib',  | 
83 |  | - '-l<(GTK_Root)/lib/libpng.lib',  | 
84 |  | - '-l<(GTK_Root)/lib/pangocairo-1.0.lib',  | 
85 |  | - '-l<(GTK_Root)/lib/pango-1.0.lib',  | 
86 |  | - '-l<(GTK_Root)/lib/freetype.lib',  | 
87 |  | - '-l<(GTK_Root)/lib/glib-2.0.lib',  | 
88 |  | - '-l<(GTK_Root)/lib/gobject-2.0.lib'  | 
89 |  | - ],  | 
90 |  | - 'include_dirs': [  | 
91 |  | - '<(GTK_Root)/include',  | 
92 |  | - '<(GTK_Root)/include/cairo',  | 
93 |  | - '<(GTK_Root)/include/pango-1.0',  | 
94 |  | - '<(GTK_Root)/include/glib-2.0',  | 
95 |  | - '<(GTK_Root)/include/freetype2',  | 
96 |  | - '<(GTK_Root)/lib/glib-2.0/include'  | 
97 |  | - ],  | 
98 |  | - 'defines': [  | 
99 |  | - '_USE_MATH_DEFINES', # for M_PI  | 
100 |  | - 'NOMINMAX' # allow std::min/max to work  | 
101 |  | - ],  | 
102 |  | - 'configurations': {  | 
103 |  | - 'Debug': {  | 
104 |  | - 'msvs_settings': {  | 
105 |  | - 'VCCLCompilerTool': {  | 
106 |  | - 'WarningLevel': 4,  | 
107 |  | - 'ExceptionHandling': 1,  | 
108 |  | - 'DisableSpecificWarnings': [  | 
109 |  | - 4100, 4611  | 
110 |  | - ]  | 
111 |  | - }  | 
112 |  | - }  | 
113 |  | - },  | 
114 |  | - 'Release': {  | 
115 |  | - 'msvs_settings': {  | 
116 |  | - 'VCCLCompilerTool': {  | 
117 |  | - 'WarningLevel': 4,  | 
118 |  | - 'ExceptionHandling': 1,  | 
119 |  | - 'DisableSpecificWarnings': [  | 
120 |  | - 4100, 4611  | 
121 |  | - ]  | 
122 |  | - }  | 
123 |  | - }  | 
124 |  | - }  | 
125 |  | - }  | 
126 |  | - }, { # 'OS!="win"'  | 
127 |  | - 'libraries': [  | 
128 |  | - '<!@(pkg-config pixman-1 --libs)',  | 
129 |  | - '<!@(pkg-config cairo --libs)',  | 
130 |  | - '<!@(pkg-config libpng --libs)',  | 
131 |  | - '<!@(pkg-config pangocairo --libs)',  | 
132 |  | - '<!@(pkg-config freetype2 --libs)'  | 
133 |  | - ],  | 
134 |  | - 'include_dirs': [  | 
135 |  | - '<!@(pkg-config cairo --cflags-only-I | sed s/-I//g)',  | 
136 |  | - '<!@(pkg-config libpng --cflags-only-I | sed s/-I//g)',  | 
137 |  | - '<!@(pkg-config pangocairo --cflags-only-I | sed s/-I//g)',  | 
138 |  | - '<!@(pkg-config freetype2 --cflags-only-I | sed s/-I//g)'  | 
139 |  | - ],  | 
140 |  | - 'cflags': ['-Wno-cast-function-type'],  | 
141 |  | - 'cflags!': ['-fno-exceptions'],  | 
142 |  | - 'cflags_cc!': ['-fno-exceptions']  | 
143 |  | - }],  | 
144 |  | - ['OS=="mac"', {  | 
145 |  | - 'xcode_settings': {  | 
146 |  | - 'GCC_ENABLE_CPP_EXCEPTIONS': 'YES'  | 
147 |  | - }  | 
148 |  | - }],  | 
149 |  | - ['with_jpeg=="true"', {  | 
150 |  | - 'defines': [  | 
151 |  | - 'HAVE_JPEG'  | 
152 |  | - ],  | 
153 |  | - 'conditions': [  | 
154 |  | - ['OS=="win"', {  | 
155 |  | - 'copies': [{  | 
156 |  | - 'destination': '<(PRODUCT_DIR)',  | 
157 |  | - 'files': [  | 
158 |  | - '<(jpeg_root)/bin/jpeg62.dll',  | 
159 |  | - ]  | 
160 |  | - }],  | 
161 |  | - 'include_dirs': [  | 
162 |  | - '<(jpeg_root)/include'  | 
163 |  | - ],  | 
164 |  | - 'libraries': [  | 
165 |  | - '-l<(jpeg_root)/lib/jpeg.lib',  | 
166 |  | - ]  | 
167 |  | - }, {  | 
168 |  | - 'include_dirs': [  | 
169 |  | - '<!@(pkg-config libjpeg --cflags-only-I | sed s/-I//g)'  | 
170 |  | - ],  | 
171 |  | - 'libraries': [  | 
172 |  | - '<!@(pkg-config libjpeg --libs)'  | 
173 |  | - ]  | 
174 |  | - }]  | 
175 |  | - ]  | 
176 |  | - }],  | 
177 |  | - ['with_gif=="true"', {  | 
178 |  | - 'defines': [  | 
179 |  | - 'HAVE_GIF'  | 
180 |  | - ],  | 
181 |  | - 'conditions': [  | 
182 |  | - ['OS=="win"', {  | 
183 |  | - 'libraries': [  | 
184 |  | - '-l<(GTK_Root)/lib/gif.lib'  | 
185 |  | - ]  | 
186 |  | - }, {  | 
187 |  | - 'include_dirs': [  | 
188 |  | - '/opt/homebrew/include'  | 
189 |  | - ],  | 
190 |  | - 'libraries': [  | 
191 |  | - '-L/opt/homebrew/lib',  | 
192 |  | - '-lgif'  | 
193 |  | - ]  | 
194 |  | - }]  | 
195 |  | - ]  | 
196 |  | - }],  | 
197 |  | - ['with_rsvg=="true"', {  | 
198 |  | - 'defines': [  | 
199 |  | - 'HAVE_RSVG'  | 
200 |  | - ],  | 
201 |  | - 'conditions': [  | 
202 |  | - ['OS=="win"', {  | 
203 |  | - 'copies': [{  | 
204 |  | - 'destination': '<(PRODUCT_DIR)',  | 
205 |  | - 'files': [  | 
206 |  | - '<(GTK_Root)/bin/librsvg-2-2.dll',  | 
207 |  | - '<(GTK_Root)/bin/libgdk_pixbuf-2.0-0.dll',  | 
208 |  | - '<(GTK_Root)/bin/libgio-2.0-0.dll',  | 
209 |  | - '<(GTK_Root)/bin/libcroco-0.6-3.dll',  | 
210 |  | - '<(GTK_Root)/bin/libgsf-1-114.dll',  | 
211 |  | - '<(GTK_Root)/bin/libxml2-2.dll'  | 
212 |  | - ]  | 
213 |  | - }],  | 
214 |  | - 'libraries': [  | 
215 |  | - '-l<(GTK_Root)/lib/librsvg-2-2.lib'  | 
216 |  | - ]  | 
217 |  | - }, {  | 
218 |  | - 'include_dirs': [  | 
219 |  | - '<!@(pkg-config librsvg-2.0 --cflags-only-I | sed s/-I//g)'  | 
220 |  | - ],  | 
221 |  | - 'libraries': [  | 
222 |  | - '<!@(pkg-config librsvg-2.0 --libs)'  | 
223 |  | - ]  | 
224 |  | - }]  | 
225 |  | - ]  | 
226 |  | - }]  | 
227 |  | - ]  | 
 | 23 | + 'defines': [  | 
 | 24 | + 'HAVE_GIF',  | 
 | 25 | + 'HAVE_JPEG',  | 
 | 26 | + 'HAVE_RSVG'  | 
 | 27 | + ],  | 
 | 28 | + 'libraries': [  | 
 | 29 | + '<!@(pkg-config pixman-1 --libs)',  | 
 | 30 | + '<!@(pkg-config cairo --libs)',  | 
 | 31 | + '<!@(pkg-config libpng --libs)',  | 
 | 32 | + '<!@(pkg-config pangocairo --libs)',  | 
 | 33 | + '<!@(pkg-config freetype2 --libs)',  | 
 | 34 | + '<!@(pkg-config librsvg-2.0 --libs)',  | 
 | 35 | + '-ljpeg',  | 
 | 36 | + '-lgif'  | 
 | 37 | + ],  | 
 | 38 | + 'include_dirs': [  | 
 | 39 | + '<!(node -e "require(\'nan\')")',  | 
 | 40 | + '<!@(pkg-config cairo --cflags-only-I | sed s/-I//g)',  | 
 | 41 | + '<!@(pkg-config libpng --cflags-only-I | sed s/-I//g)',  | 
 | 42 | + '<!@(pkg-config pangocairo --cflags-only-I | sed s/-I//g)',  | 
 | 43 | + '<!@(pkg-config freetype2 --cflags-only-I | sed s/-I//g)',  | 
 | 44 | + '<!@(pkg-config librsvg-2.0 --cflags-only-I | sed s/-I//g)'  | 
 | 45 | + ],  | 
 | 46 | + 'ldflags': [  | 
 | 47 | + '-Wl,-rpath \'-Wl,$$ORIGIN\''  | 
 | 48 | + ],  | 
 | 49 | + 'cflags!': ['-fno-exceptions'],  | 
 | 50 | + 'cflags_cc!': ['-fno-exceptions']  | 
228 | 51 |  }  | 
229 | 52 |  ]  | 
230 | 53 | }  | 
0 commit comments