Add PRESUBMIT check if modified UMA histogram name can be found (2)
[chromium-blink-merge.git] / pdf / pdf.gyp
blob022592153f048f8c38e101102d434f1adf5c9e45
2   'variables': {
3     'chromium_code': 1,
4     'pdf_engine%': 0,  # 0 PDFium
5   },
6   'target_defaults': {
7     'cflags': [
8       '-fPIC',
9     ],
10   },
11   'targets': [
12     {
13       'target_name': 'pdf',
14       'type': 'loadable_module',
15       'msvs_guid': '647863C0-C7A3-469A-B1ED-AD7283C34BED',
16       'dependencies': [
17         '../base/base.gyp:base',
18         '../net/net.gyp:net',
19         '../ppapi/ppapi.gyp:ppapi_cpp',
20         '../third_party/pdfium/pdfium.gyp:pdfium',
21       ],
22       'xcode_settings': {
23         'INFOPLIST_FILE': 'Info.plist',
24       },
25       'mac_framework_dirs': [
26         '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework/Frameworks',
27       ],
28       'ldflags': [ '-L<(PRODUCT_DIR)',],
29       'sources': [
30         'button.h',
31         'button.cc',
32         'chunk_stream.h',
33         'chunk_stream.cc',
34         'control.h',
35         'control.cc',
36         'document_loader.h',
37         'document_loader.cc',
38         'draw_utils.cc',
39         'draw_utils.h',
40         'fading_control.cc',
41         'fading_control.h',
42         'fading_controls.cc',
43         'fading_controls.h',
44         'instance.cc',
45         'instance.h',
46         'number_image_generator.cc',
47         'number_image_generator.h',
48         'out_of_process_instance.cc',
49         'out_of_process_instance.h',
50         'page_indicator.cc',
51         'page_indicator.h',
52         'paint_aggregator.cc',
53         'paint_aggregator.h',
54         'paint_manager.cc',
55         'paint_manager.h',
56         'pdf.cc',
57         'pdf.h',
58         'pdf.rc',
59         'progress_control.cc',
60         'progress_control.h',
61         'pdf_engine.h',
62         'preview_mode_client.cc',
63         'preview_mode_client.h',
64         'resource.h',
65         'resource_consts.h',
66         'thumbnail_control.cc',
67         'thumbnail_control.h',
68         '../components/ui/zoom/page_zoom_constants.cc',
69         '../content/common/page_zoom.cc',
70       ],
71       'conditions': [
72         ['pdf_engine==0', {
73           'sources': [
74             'pdfium/pdfium_api_string_buffer_adapter.cc',
75             'pdfium/pdfium_api_string_buffer_adapter.h',
76             'pdfium/pdfium_assert_matching_enums.cc',
77             'pdfium/pdfium_engine.cc',
78             'pdfium/pdfium_engine.h',
79             'pdfium/pdfium_mem_buffer_file_read.cc',
80             'pdfium/pdfium_mem_buffer_file_read.h',
81             'pdfium/pdfium_mem_buffer_file_write.cc',
82             'pdfium/pdfium_mem_buffer_file_write.h',
83             'pdfium/pdfium_page.cc',
84             'pdfium/pdfium_page.h',
85             'pdfium/pdfium_range.cc',
86             'pdfium/pdfium_range.h',
87           ],
88         }],
89         ['OS!="win"', {
90           'sources!': [
91             'pdf.rc',
92           ],
93         }],
94         ['OS=="mac"', {
95           'mac_bundle': 1,
96           'product_name': 'PDF',
97           'product_extension': 'plugin',
98           # Strip the shipping binary of symbols so "Foxit" doesn't appear in
99           # the binary.  Symbols are stored in a separate .dSYM.
100           'variables': {
101             'mac_real_dsym': 1,
102           },
103           'sources+': [
104             'Info.plist'
105           ],
106         }],
107         ['OS=="win"', {
108           'defines': [
109             'COMPILE_CONTENT_STATICALLY',
110           ],
111           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
112           'msvs_disabled_warnings': [ 4267, ],
113         }],
114         ['OS=="linux"', {
115           'configurations': {
116             'Release_Base': {
117               #'cflags': [ '-fno-weak',],  # get rid of symbols that strip doesn't remove.
118               # Don't do this for now since official builder will take care of it.  That
119               # way symbols can still be uploaded to the crash server.
120               #'ldflags': [ '-s',],  # strip local symbols from binary.
121             },
122           },
123         }],
124       ],
125     },
126   ],
127   'conditions': [
128     # CrOS has a separate step to do this.
129     ['OS=="linux" and chromeos==0',
130       { 'targets': [
131         {
132           'target_name': 'pdf_linux_symbols',
133           'type': 'none',
134           'conditions': [
135             ['linux_dump_symbols==1', {
136               'actions': [
137                 {
138                   'action_name': 'dump_symbols',
139                   'inputs': [
140                     '<(DEPTH)/build/linux/dump_app_syms',
141                     '<(PRODUCT_DIR)/dump_syms',
142                     '<(PRODUCT_DIR)/libpdf.so',
143                   ],
144                   'outputs': [
145                     '<(PRODUCT_DIR)/libpdf.so.breakpad.<(target_arch)',
146                   ],
147                   'action': ['<(DEPTH)/build/linux/dump_app_syms',
148                              '<(PRODUCT_DIR)/dump_syms',
149                              '<(linux_strip_binary)',
150                              '<(PRODUCT_DIR)/libpdf.so',
151                              '<@(_outputs)'],
152                   'message': 'Dumping breakpad symbols to <(_outputs)',
153                   'process_outputs_as_sources': 1,
154                 },
155               ],
156               'dependencies': [
157                 'pdf',
158                 '../breakpad/breakpad.gyp:dump_syms',
159               ],
160             }],
161           ],
162         },
163       ],
164     },],  # OS=="linux" and chromeos==0
165     ['OS=="win" and fastbuild==0 and target_arch=="ia32" and syzyasan==1', {
166       'variables': {
167         'dest_dir': '<(PRODUCT_DIR)/syzygy',
168       },
169       'targets': [
170         {
171           'target_name': 'pdf_syzyasan',
172           'type': 'none',
173           'sources' : [],
174           'dependencies': [
175             'pdf',
176           ],
177           # Instrument PDFium with SyzyAsan.
178           'actions': [
179             {
180               'action_name': 'Instrument PDFium with SyzyAsan',
181               'inputs': [
182                 '<(PRODUCT_DIR)/pdf.dll',
183               ],
184               'outputs': [
185                 '<(dest_dir)/pdf.dll',
186                 '<(dest_dir)/pdf.dll.pdb',
187               ],
188               'action': [
189                 'python',
190                 '<(DEPTH)/chrome/tools/build/win/syzygy/instrument.py',
191                 '--mode', 'asan',
192                 '--input_executable', '<(PRODUCT_DIR)/pdf.dll',
193                 '--input_symbol', '<(PRODUCT_DIR)/pdf.dll.pdb',
194                 '--destination_dir', '<(dest_dir)',
195               ],
196             },
197           ],
198         },
199       ],
200     }],  # OS=="win" and fastbuild==0 and target_arch=="ia32" and syzyasan==1
201   ],