blob: 3371745545e477e95c4ab29a9701e31d31d9f4c4 [file] [log] [blame]
Torne (Richard Coles)58218062012-11-14 11:43:16 +00001# 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.
4
5{
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',
Torne (Richard Coles)58218062012-11-14 11:43:16 +000017 '../skia/skia.gyp:skia',
18 '../third_party/icu/icu.gyp:icui18n',
19 '../third_party/icu/icu.gyp:icuuc',
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +010020 '../ui/gfx/gfx.gyp:gfx',
Torne (Richard Coles)1e9bf3e2013-10-31 11:16:26 +000021 '../ui/shell_dialogs/shell_dialogs.gyp:shell_dialogs',
Torne (Richard Coles)868fa2f2013-06-11 10:57:03 +010022 '../url/url.gyp:url_lib',
Torne (Richard Coles)58218062012-11-14 11:43:16 +000023 ],
24 'defines': [
25 'PRINTING_IMPLEMENTATION',
26 ],
27 'include_dirs': [
28 '..',
29 ],
30 'sources': [
31 'backend/print_backend.cc',
32 'backend/print_backend.h',
33 'backend/print_backend_consts.cc',
34 'backend/print_backend_consts.h',
35 'backend/print_backend_dummy.cc',
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +000036 'backend/printing_info_win.cc',
37 'backend/printing_info_win.h',
Torne (Richard Coles)58218062012-11-14 11:43:16 +000038 'emf_win.cc',
39 'emf_win.h',
40 'image.cc',
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +000041 'image.h',
Torne (Richard Coles)3551c9c2013-08-23 16:39:15 +010042 'image_android.cc',
Torne (Richard Coles)58218062012-11-14 11:43:16 +000043 'image_linux.cc',
44 'image_mac.cc',
45 'image_win.cc',
Torne (Richard Coles)58218062012-11-14 11:43:16 +000046 'metafile.h',
47 'metafile_impl.h',
Torne (Richard Coles)58218062012-11-14 11:43:16 +000048 'metafile_skia_wrapper.cc',
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +000049 'metafile_skia_wrapper.h',
Torne (Richard Coles)58218062012-11-14 11:43:16 +000050 'page_number.cc',
51 'page_number.h',
52 'page_range.cc',
53 'page_range.h',
54 'page_setup.cc',
55 'page_setup.h',
56 'page_size_margins.cc',
57 'page_size_margins.h',
58 'pdf_metafile_cg_mac.cc',
59 'pdf_metafile_cg_mac.h',
Torne (Richard Coles)58218062012-11-14 11:43:16 +000060 'pdf_metafile_skia.cc',
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +000061 'pdf_metafile_skia.h',
Torne (Richard Coles)58218062012-11-14 11:43:16 +000062 'print_destination_interface.h',
63 'print_destination_none.cc',
64 'print_destination_win.cc',
Torne (Richard Coles)58218062012-11-14 11:43:16 +000065 'print_dialog_gtk_interface.h',
66 'print_job_constants.cc',
67 'print_job_constants.h',
68 'print_settings.cc',
69 'print_settings.h',
70 'print_settings_initializer.cc',
71 'print_settings_initializer.h',
72 'print_settings_initializer_gtk.cc',
73 'print_settings_initializer_gtk.h',
74 'print_settings_initializer_mac.cc',
75 'print_settings_initializer_mac.h',
76 'print_settings_initializer_win.cc',
77 'print_settings_initializer_win.h',
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +000078 'printed_document.cc',
79 'printed_document.h',
80 'printed_document_gtk.cc',
81 'printed_document_mac.cc',
82 'printed_document_win.cc',
83 'printed_page.cc',
84 'printed_page.h',
85 'printed_pages_source.h',
86 'printing_context.cc',
87 'printing_context.h',
88 'printing_utils.cc',
89 'printing_utils.h',
Torne (Richard Coles)58218062012-11-14 11:43:16 +000090 'units.cc',
91 'units.h',
92 ],
93 'direct_dependent_settings': {
94 'include_dirs': [
95 '..',
96 ],
97 },
98 'conditions': [
Torne (Richard Coles)90dce4d2013-05-29 14:40:03 +010099 ['use_aura==1', {
100 'dependencies': [
101 '<(DEPTH)/ui/aura/aura.gyp:aura',
102 ],
103 }],
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000104 ['toolkit_uses_gtk == 0',{
105 'sources/': [['exclude', '_cairo\\.cc$']]
106 }],
107 ['OS!="mac"', {'sources/': [['exclude', '_mac\\.(cc|mm?)$']]}],
108 ['OS!="win"', {'sources/': [['exclude', '_win\\.cc$']]
109 }, { # else: OS=="win"
110 'sources/': [['exclude', '_posix\\.cc$']]
111 }],
112 ['toolkit_uses_gtk == 1', {
113 'dependencies': [
114 # For FT_Init_FreeType and friends.
115 '../build/linux/system.gyp:freetype2',
116 '../build/linux/system.gyp:gtk',
117 '../build/linux/system.gyp:gtkprint',
118 ],
119 }],
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000120 # Mac-Aura does not support printing.
121 ['OS=="mac" and use_aura==1',{
122 'sources!': [
123 'printed_document_mac.cc',
124 'printing_context_mac.mm',
125 'printing_context_mac.h',
126 ],
127 }],
128 ['OS=="mac" and use_aura==0',{
129 'sources': [
130 'printing_context_mac.mm',
131 'printing_context_mac.h',
132 ],
133 }],
134 ['OS=="win"', {
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000135 'dependencies': [
136 '../win8/win8.gyp:win8_util',
137 ],
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000138 'conditions': [
Torne (Richard Coles)90dce4d2013-05-29 14:40:03 +0100139 ['use_aura==1', {
140 'dependencies': [
141 '<(DEPTH)/ui/aura/aura.gyp:aura',
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000142 ],
143 }]],
144 'defines': [
145 # PRINT_BACKEND_AVAILABLE disables the default dummy implementation
146 # of the print backend and enables a custom implementation instead.
147 'PRINT_BACKEND_AVAILABLE',
148 ],
149 'sources': [
150 'backend/win_helper.cc',
151 'backend/win_helper.h',
152 'backend/print_backend_win.cc',
Torne (Richard Coles)90dce4d2013-05-29 14:40:03 +0100153 'printing_context_win.cc',
154 'printing_context_win.h',
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000155 ],
156 'sources!': [
157 'print_destination_none.cc',
158 ],
159 }],
Torne (Richard Coles)90dce4d2013-05-29 14:40:03 +0100160 ['chromeos==1 or (use_aura==1 and OS!="win")',{
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000161 'sources': [
162 'printing_context_no_system_dialog.cc',
163 'printing_context_no_system_dialog.h',
164 ],
165 }],
166 ['use_cups==1', {
167 'dependencies': [
168 'cups',
169 ],
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100170 'variables': {
171 'cups_version': '<!(cups-config --api-version)',
172 },
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000173 'conditions': [
174 ['OS!="mac"', {
175 'dependencies': [
176 '../build/linux/system.gyp:libgcrypt',
177 ],
178 }],
Ben Murdocheb525c52013-07-10 11:40:50 +0100179 ['cups_version in ["1.6", "1.7"]', {
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100180 'cflags': [
181 # CUPS 1.6 deprecated the PPD APIs, but we will stay with this
182 # API for now as supported Linux and Mac OS'es are still using
183 # older versions of CUPS. More info: crbug.com/226176
184 '-Wno-deprecated-declarations',
Ben Murdocheb525c52013-07-10 11:40:50 +0100185 # CUPS 1.7 deprecates httpConnectEncrypt(), see the mac section
186 # below.
Torne (Richard Coles)c2e0dbd2013-05-09 18:35:53 +0100187 ],
188 }],
Ben Murdocheb525c52013-07-10 11:40:50 +0100189 ['OS=="mac" and mac_sdk=="10.9"', {
190 # The 10.9 SDK includes cups 1.7, which deprecates
191 # httpConnectEncrypt() in favor of httpConnect2(). hhttpConnect2()
192 # is new in 1.7, so it doesn't exist on OS X 10.6-10.8 and we
193 # can't use it until 10.9 is our minimum system version.
194 # (cups_version isn't reliable on OS X, so key the check off of
195 # mac_sdk).
196 'xcode_settings': {
197 'WARNING_CFLAGS': [
198 '-Wno-deprecated-declarations',
199 ],
200 },
201 }],
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000202 ],
203 'defines': [
204 # PRINT_BACKEND_AVAILABLE disables the default dummy implementation
205 # of the print backend and enables a custom implementation instead.
206 'PRINT_BACKEND_AVAILABLE',
207 ],
208 'sources': [
209 'backend/cups_helper.cc',
210 'backend/cups_helper.h',
211 'backend/print_backend_cups.cc',
212 ],
213 }],
214 ['OS=="linux" and chromeos==1', {
215 'defines': [
216 # PRINT_BACKEND_AVAILABLE disables the default dummy implementation
217 # of the print backend and enables a custom implementation instead.
218 'PRINT_BACKEND_AVAILABLE',
219 ],
220 'sources': [
221 'backend/print_backend_chromeos.cc',
222 ],
223 }],
224 ['toolkit_uses_gtk==1 and chromeos==0', {
225 'sources': [
226 'printing_context_gtk.cc',
227 'printing_context_gtk.h',
228 ],
229 }],
Torne (Richard Coles)3551c9c2013-08-23 16:39:15 +0100230 ['OS=="android"', {
231 'sources': [
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000232 'printing_context_android.cc',
Torne (Richard Coles)3551c9c2013-08-23 16:39:15 +0100233 'printing_context_android.h',
234 ],
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000235 'dependencies': [
236 'printing_jni_headers',
237 ],
238 'include_dirs': [
239 '<(SHARED_INTERMEDIATE_DIR)/printing',
240 ],
Torne (Richard Coles)3551c9c2013-08-23 16:39:15 +0100241 }],
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000242 ],
243 },
244 {
245 'target_name': 'printing_unittests',
246 'type': 'executable',
247 'dependencies': [
248 'printing',
249 '../testing/gtest.gyp:gtest',
Torne (Richard Coles)58537e22013-09-12 12:10:22 +0100250 '../base/base.gyp:run_all_unittests',
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000251 '../base/base.gyp:test_support_base',
Torne (Richard Coles)4e180b62013-10-18 15:46:22 +0100252 '../ui/gfx/gfx.gyp:gfx',
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000253 '../ui/ui.gyp:ui',
254 ],
255 'sources': [
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000256 'emf_win_unittest.cc',
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000257 'page_number_unittest.cc',
258 'page_range_unittest.cc',
259 'page_setup_unittest.cc',
260 'pdf_metafile_cg_mac_unittest.cc',
261 'printed_page_unittest.cc',
Torne (Richard Coles)0f1bc082013-11-06 12:27:47 +0000262 'printing_context_win_unittest.cc',
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000263 'printing_test.h',
264 'printing_utils_unittest.cc',
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000265 'units_unittest.cc',
266 ],
267 'conditions': [
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000268 ['toolkit_uses_gtk == 0', {'sources/': [['exclude', '_gtk_unittest\\.cc$']]}],
269 ['OS!="mac"', {'sources/': [['exclude', '_mac_unittest\\.(cc|mm?)$']]}],
270 ['OS!="win"', {'sources/': [['exclude', '_win_unittest\\.cc$']]}],
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000271 ['use_cups==1', {
272 'defines': [
273 'USE_CUPS',
274 ],
275 'sources': [
276 'backend/cups_helper_unittest.cc',
277 ],
278 }],
279 ['toolkit_uses_gtk == 1', {
280 'dependencies': [
281 '../build/linux/system.gyp:gtk',
282 ],
283 }],
284 [ 'os_posix == 1 and OS != "mac" and OS != "android" and OS != "ios"', {
285 'conditions': [
286 ['linux_use_tcmalloc == 1', {
287 'dependencies': [
288 '../base/allocator/allocator.gyp:allocator',
289 ],
290 }],
291 ],
292 }],
293 ],
Torne (Richard Coles)2a99a7e2013-03-28 15:31:22 +0000294 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
295 'msvs_disabled_warnings': [ 4267, ],
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000296 },
297 {
298 'target_name': 'cups',
299 'type': 'none',
300 'conditions': [
301 ['use_cups==1', {
302 'direct_dependent_settings': {
303 'defines': [
304 'USE_CUPS',
305 ],
306 'conditions': [
307 ['OS=="mac"', {
308 'link_settings': {
309 'libraries': [
310 '$(SDKROOT)/usr/lib/libcups.dylib',
311 ]
312 },
313 }, {
314 'link_settings': {
315 'libraries': [
316 '<!@(python cups_config_helper.py --libs)',
317 ],
318 },
319 }],
320 [ 'os_bsd==1', {
321 'cflags': [
322 '<!@(python cups_config_helper.py --cflags)',
323 ],
324 }],
325 ],
326 },
327 }],
328 ],
329 },
330 ],
Torne (Richard Coles)f2477e02013-11-28 11:55:43 +0000331 'conditions': [
332 ['OS == "android"', {
333 'targets': [
334 {
335 'target_name': 'printing_jni_headers',
336 'type': 'none',
337 'sources': [
338 'android/java/src/org/chromium/printing/PrintingContext.java',
339 ],
340 'variables': {
341 'jni_gen_package': 'printing',
342 'jni_generator_ptr_type': 'long',
343 },
344 'includes': [ '../build/jni_generator.gypi' ],
345 },
346 {
347 'target_name': 'printing_java',
348 'type': 'none',
349 'variables': {
350 'java_in_dir': '../printing/android/java',
351 },
352 'dependencies': [
353 '../base/base.gyp:base_java',
354 ],
355 'includes': [ '../build/java.gypi' ],
356 }
357 ]
358 }],
359 ]
Torne (Richard Coles)58218062012-11-14 11:43:16 +0000360}