Do not use visibility:visible in user pods
[chromium-blink-merge.git] / printing / printing.gyp
blob8490a03b3fcd89b6c64bf22c2554a84dbf04b816
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6   'variables': {
7     'chromium_code': 1,
8   },
9   'targets': [
10     {
11       'target_name': 'printing',
12       'type': '<(component)',
13       'dependencies': [
14         '../base/base.gyp:base',
15         '../base/base.gyp:base_i18n',
16         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
17         '../build/temp_gyp/googleurl.gyp:googleurl',
18         '../skia/skia.gyp:skia',
19         '../third_party/icu/icu.gyp:icui18n',
20         '../third_party/icu/icu.gyp:icuuc',
21         '../ui/ui.gyp:ui',
22       ],
23       'defines': [
24         'PRINTING_IMPLEMENTATION',
25       ],
26       'include_dirs': [
27         '..',
28       ],
29       'sources': [
30         'backend/print_backend.cc',
31         'backend/print_backend.h',
32         'backend/print_backend_consts.cc',
33         'backend/print_backend_consts.h',
34         'backend/print_backend_dummy.cc',
35         'backend/printing_info_win.cc',
36         'backend/printing_info_win.h',
37         'emf_win.cc',
38         'emf_win.h',
39         'image.cc',
40         'image_linux.cc',
41         'image_mac.cc',
42         'image_win.cc',
43         'image.h',
44         'metafile.h',
45         'metafile_impl.h',
46         'metafile_skia_wrapper.h',
47         'metafile_skia_wrapper.cc',
48         'page_number.cc',
49         'page_number.h',
50         'page_range.cc',
51         'page_range.h',
52         'page_setup.cc',
53         'page_setup.h',
54         'page_size_margins.cc',
55         'page_size_margins.h',
56         'pdf_metafile_cg_mac.cc',
57         'pdf_metafile_cg_mac.h',
58         'pdf_metafile_skia.h',
59         'pdf_metafile_skia.cc',
60         'print_destination_interface.h',
61         'print_destination_none.cc',
62         'print_destination_win.cc',
63         'printed_document_gtk.cc',
64         'printed_document.cc',
65         'printed_document.h',
66         'printed_document_mac.cc',
67         'printed_document_win.cc',
68         'printed_page.cc',
69         'printed_page.h',
70         'printed_pages_source.h',
71         'printing_context.cc',
72         'printing_context.h',
73         'print_dialog_gtk_interface.h',
74         'print_job_constants.cc',
75         'print_job_constants.h',
76         'print_settings.cc',
77         'print_settings.h',
78         'print_settings_initializer.cc',
79         'print_settings_initializer.h',
80         'print_settings_initializer_gtk.cc',
81         'print_settings_initializer_gtk.h',
82         'print_settings_initializer_mac.cc',
83         'print_settings_initializer_mac.h',
84         'print_settings_initializer_win.cc',
85         'print_settings_initializer_win.h',
86         'units.cc',
87         'units.h',
88       ],
89       'direct_dependent_settings': {
90         'include_dirs': [
91           '..',
92         ],
93       },
94       'conditions': [
95         ['enable_printing!=1', {
96           'sources/': [
97             ['exclude', '.'],
98           ],
99         }],
100         ['toolkit_uses_gtk == 0',{
101             'sources/': [['exclude', '_cairo\\.cc$']]
102         }],
103         ['OS!="mac"', {'sources/': [['exclude', '_mac\\.(cc|mm?)$']]}],
104         ['OS!="win"', {'sources/': [['exclude', '_win\\.cc$']]
105           }, {  # else: OS=="win"
106             'sources/': [['exclude', '_posix\\.cc$']]
107         }],
108         ['toolkit_uses_gtk == 1', {
109           'dependencies': [
110             # For FT_Init_FreeType and friends.
111             '../build/linux/system.gyp:freetype2',
112             '../build/linux/system.gyp:gtk',
113             '../build/linux/system.gyp:gtkprint',
114           ],
115         }],
116         # Mac-Aura does not support printing.
117         ['OS=="mac" and use_aura==1',{
118           'sources!': [
119             'printed_document_mac.cc',
120             'printing_context_mac.mm',
121             'printing_context_mac.h',
122           ],
123         }],
124         ['OS=="mac" and use_aura==0',{
125           'sources': [
126             'printing_context_mac.mm',
127             'printing_context_mac.h',
128           ],
129         }],
130         ['OS=="win"', {
131           'dependencies': [
132             '../win8/win8.gyp:win8_util',
133           ],
134           'conditions': [
135             ['use_aura==0', {
136               'sources': [
137                 'printing_context_win.cc',
138                 'printing_context_win.h',
139               ],
140           }]],
141           'defines': [
142             # PRINT_BACKEND_AVAILABLE disables the default dummy implementation
143             # of the print backend and enables a custom implementation instead.
144             'PRINT_BACKEND_AVAILABLE',
145           ],
146           'sources': [
147             'backend/win_helper.cc',
148             'backend/win_helper.h',
149             'backend/print_backend_win.cc',
150           ],
151           'sources!': [
152             'print_destination_none.cc',
153           ],
154         }],
155         ['chromeos==1 or use_aura==1',{
156           'sources': [
157             'printing_context_no_system_dialog.cc',
158             'printing_context_no_system_dialog.h',
159           ],
160         }],
161         ['use_cups==1', {
162           'dependencies': [
163             'cups',
164           ],
165           'conditions': [
166             ['OS!="mac"', {
167               'dependencies': [
168                 '../build/linux/system.gyp:libgcrypt',
169               ],
170             }],
171           ],
172           'defines': [
173             # PRINT_BACKEND_AVAILABLE disables the default dummy implementation
174             # of the print backend and enables a custom implementation instead.
175             'PRINT_BACKEND_AVAILABLE',
176           ],
177           'sources': [
178             'backend/cups_helper.cc',
179             'backend/cups_helper.h',
180             'backend/print_backend_cups.cc',
181           ],
182         }],
183         ['OS=="linux" and chromeos==1', {
184           'defines': [
185             # PRINT_BACKEND_AVAILABLE disables the default dummy implementation
186             # of the print backend and enables a custom implementation instead.
187             'PRINT_BACKEND_AVAILABLE',
188           ],
189           'sources': [
190             'backend/print_backend_chromeos.cc',
191           ],
192         }],
193         ['toolkit_uses_gtk==1 and chromeos==0', {
194           'sources': [
195             'printing_context_gtk.cc',
196             'printing_context_gtk.h',
197           ],
198         }],
199       ],
200     },
201     {
202       'target_name': 'printing_unittests',
203       'type': 'executable',
204       'dependencies': [
205         'printing',
206         '../testing/gtest.gyp:gtest',
207         '../base/base.gyp:test_support_base',
208         '../ui/ui.gyp:ui',
209       ],
210       'sources': [
211         'backend/print_backend_unittest.cc',
212         'emf_win_unittest.cc',
213         'printing_test.h',
214         'page_number_unittest.cc',
215         'page_range_unittest.cc',
216         'page_setup_unittest.cc',
217         'pdf_metafile_cg_mac_unittest.cc',
218         'printed_page_unittest.cc',
219         'run_all_unittests.cc',
220         'units_unittest.cc',
221       ],
222       'conditions': [
223         ['enable_printing!=1', {
224           'sources/': [
225             ['exclude', '.'],
226             ['include', 'run_all_unittests.cc'],
227           ],
228         }],
229         ['toolkit_uses_gtk == 0', {'sources/': [['exclude', '_gtk_unittest\\.cc$']]}],
230         ['OS!="mac"', {'sources/': [['exclude', '_mac_unittest\\.(cc|mm?)$']]}],
231         ['OS!="win"', {'sources/': [['exclude', '_win_unittest\\.cc$']]}],
232         ['OS=="win" and use_aura == 0', {
233           'sources': [
234             'printing_context_win_unittest.cc',
235           ]
236         }],
237         ['use_cups==1', {
238           'defines': [
239             'USE_CUPS',
240           ],
241           'sources': [
242             'backend/cups_helper_unittest.cc',
243           ],
244         }],
245         ['toolkit_uses_gtk == 1', {
246           'dependencies': [
247             '../build/linux/system.gyp:gtk',
248           ],
249         }],
250         [ 'os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', {
251           'conditions': [
252             ['linux_use_tcmalloc == 1', {
253               'dependencies': [
254                 '../base/allocator/allocator.gyp:allocator',
255               ],
256             }],
257           ],
258         }],
259       ],
260       # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
261       'msvs_disabled_warnings': [ 4267, ],
262     },
263     {
264       'target_name': 'cups',
265       'type': 'none',
266       'conditions': [
267         ['use_cups==1', {
268           'direct_dependent_settings': {
269             'defines': [
270               'USE_CUPS',
271             ],
272             'conditions': [
273               ['OS=="mac"', {
274                 'link_settings': {
275                   'libraries': [
276                     '$(SDKROOT)/usr/lib/libcups.dylib',
277                   ]
278                 },
279               }, {
280                 'link_settings': {
281                   'libraries': [
282                     '<!@(python cups_config_helper.py --libs)',
283                   ],
284                 },
285               }],
286               [ 'os_bsd==1', {
287                 'cflags': [
288                   '<!@(python cups_config_helper.py --cflags)',
289                 ],
290               }],
291             ],
292           },
293         }],
294       ],
295     },
296   ],