1# Copyright 2014 Google Inc. All rights reserved.
2#
3# Redistribution and use in source and binary forms, with or without
4# modification, are permitted provided that the following conditions are
5# met:
6#
7#     * Redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer.
9#     * Redistributions in binary form must reproduce the above
10# copyright notice, this list of conditions and the following disclaimer
11# in the documentation and/or other materials provided with the
12# distribution.
13#     * Neither the name of Google Inc. nor the names of its
14# contributors may be used to endorse or promote products derived from
15# this software without specific prior written permission.
16#
17# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29{
30  'target_defaults': {
31    'target_conditions': [
32      ['OS=="mac"', {
33        'defines': ['HAVE_MACH_O_NLIST_H'],
34      }],
35      ['OS=="linux"', {
36        'defines': ['HAVE_A_OUT_H'],
37      }],
38    ],
39  },
40  'targets': [
41    {
42      'target_name': 'common',
43      'type': 'static_library',
44      'sources': [
45        'android/breakpad_getcontext.S',
46        'android/include/elf.h',
47        'android/include/link.h',
48        'android/include/sgidefs.h',
49        'android/include/stab.h',
50        'android/include/sys/procfs.h',
51        'android/include/sys/signal.h',
52        'android/include/sys/user.h',
53        'android/include/ucontext.h',
54        'android/testing/include/wchar.h',
55        'android/testing/mkdtemp.h',
56        'android/testing/pthread_fixes.h',
57        'android/ucontext_constants.h',
58        'basictypes.h',
59        'byte_cursor.h',
60        'convert_UTF.c',
61        'convert_UTF.h',
62        'dwarf/bytereader-inl.h',
63        'dwarf/bytereader.cc',
64        'dwarf/bytereader.h',
65        'dwarf/cfi_assembler.cc',
66        'dwarf/cfi_assembler.h',
67        'dwarf/dwarf2diehandler.cc',
68        'dwarf/dwarf2diehandler.h',
69        'dwarf/dwarf2enums.h',
70        'dwarf/dwarf2reader.cc',
71        'dwarf/dwarf2reader.h',
72        'dwarf/dwarf2reader_test_common.h',
73        'dwarf/functioninfo.cc',
74        'dwarf/functioninfo.h',
75        'dwarf/line_state_machine.h',
76        'dwarf/types.h',
77        'dwarf_cfi_to_module.cc',
78        'dwarf_cfi_to_module.h',
79        'dwarf_cu_to_module.cc',
80        'dwarf_cu_to_module.h',
81        'dwarf_line_to_module.cc',
82        'dwarf_line_to_module.h',
83        'language.cc',
84        'language.h',
85        'linux/crc32.cc',
86        'linux/crc32.h',
87        'linux/dump_symbols.cc',
88        'linux/dump_symbols.h',
89        'linux/eintr_wrapper.h',
90        'linux/elf_core_dump.cc',
91        'linux/elf_core_dump.h',
92        'linux/elf_gnu_compat.h',
93        'linux/elf_symbols_to_module.cc',
94        'linux/elf_symbols_to_module.h',
95        'linux/elfutils-inl.h',
96        'linux/elfutils.cc',
97        'linux/elfutils.h',
98        'linux/file_id.cc',
99        'linux/file_id.h',
100        'linux/google_crashdump_uploader.cc',
101        'linux/google_crashdump_uploader.h',
102        'linux/guid_creator.cc',
103        'linux/guid_creator.h',
104        'linux/http_upload.cc',
105        'linux/http_upload.h',
106        'linux/ignore_ret.h',
107        'linux/libcurl_wrapper.cc',
108        'linux/libcurl_wrapper.h',
109        'linux/linux_libc_support.cc',
110        'linux/linux_libc_support.h',
111        'linux/memory_mapped_file.cc',
112        'linux/memory_mapped_file.h',
113        'linux/safe_readlink.cc',
114        'linux/safe_readlink.h',
115        'linux/synth_elf.cc',
116        'linux/synth_elf.h',
117        'mac/arch_utilities.cc',
118        'mac/arch_utilities.h',
119        'mac/bootstrap_compat.cc',
120        'mac/bootstrap_compat.h',
121        'mac/byteswap.h',
122        'mac/dump_syms.h',
123        'mac/dump_syms.mm',
124        'mac/file_id.cc',
125        'mac/file_id.h',
126        'mac/GTMDefines.h',
127        'mac/GTMLogger.h',
128        'mac/GTMLogger.m',
129        'mac/HTTPMultipartUpload.h',
130        'mac/HTTPMultipartUpload.m',
131        'mac/MachIPC.h',
132        'mac/MachIPC.mm',
133        'mac/macho_id.cc',
134        'mac/macho_id.h',
135        'mac/macho_reader.cc',
136        'mac/macho_reader.h',
137        'mac/macho_utilities.cc',
138        'mac/macho_utilities.h',
139        'mac/macho_walker.cc',
140        'mac/macho_walker.h',
141        'mac/scoped_task_suspend-inl.h',
142        'mac/string_utilities.cc',
143        'mac/string_utilities.h',
144        'md5.cc',
145        'md5.h',
146        'memory.h',
147        'memory_range.h',
148        'module.cc',
149        'module.h',
150        'scoped_ptr.h',
151        'simple_string_dictionary.cc',
152        'simple_string_dictionary.h',
153        'solaris/dump_symbols.cc',
154        'solaris/dump_symbols.h',
155        'solaris/file_id.cc',
156        'solaris/file_id.h',
157        'solaris/guid_creator.cc',
158        'solaris/guid_creator.h',
159        'solaris/message_output.h',
160        'stabs_reader.cc',
161        'stabs_reader.h',
162        'stabs_to_module.cc',
163        'stabs_to_module.h',
164        'string_conversion.cc',
165        'string_conversion.h',
166        'symbol_data.h',
167        'test_assembler.cc',
168        'test_assembler.h',
169        'unordered.h',
170        'using_std_string.h',
171        'windows/common_windows.gyp',
172        'windows/dia_util.cc',
173        'windows/dia_util.h',
174        'windows/guid_string.cc',
175        'windows/guid_string.h',
176        'windows/http_upload.cc',
177        'windows/http_upload.h',
178        'windows/omap.cc',
179        'windows/omap.h',
180        'windows/omap_internal.h',
181        'windows/pdb_source_line_writer.cc',
182        'windows/pdb_source_line_writer.h',
183        'windows/string_utils-inl.h',
184        'windows/string_utils.cc',
185      ],
186      'include_dirs': [
187        '..',
188      ],
189    },
190    {
191      'target_name': 'common_unittests',
192      'type': 'executable',
193      'sources': [
194        'android/breakpad_getcontext_unittest.cc',
195        'byte_cursor_unittest.cc',
196        'dwarf/bytereader_unittest.cc',
197        'dwarf/dwarf2diehandler_unittest.cc',
198        'dwarf/dwarf2reader_cfi_unittest.cc',
199        'dwarf/dwarf2reader_die_unittest.cc',
200        'dwarf_cfi_to_module_unittest.cc',
201        'dwarf_cu_to_module_unittest.cc',
202        'dwarf_line_to_module_unittest.cc',
203        'linux/dump_symbols_unittest.cc',
204        'linux/elf_core_dump_unittest.cc',
205        'linux/elf_symbols_to_module_unittest.cc',
206        'linux/file_id_unittest.cc',
207        'linux/google_crashdump_uploader_test.cc',
208        'linux/linux_libc_support_unittest.cc',
209        'linux/memory_mapped_file_unittest.cc',
210        'linux/safe_readlink_unittest.cc',
211        'linux/synth_elf_unittest.cc',
212        'linux/tests/auto_testfile.h',
213        'linux/tests/crash_generator.cc',
214        'linux/tests/crash_generator.h',
215        'mac/macho_reader_unittest.cc',
216        'memory_range_unittest.cc',
217        'memory_unittest.cc',
218        'module_unittest.cc',
219        'simple_string_dictionary_unittest.cc',
220        'stabs_reader_unittest.cc',
221        'stabs_to_module_unittest.cc',
222        'test_assembler_unittest.cc',
223        'tests/auto_tempdir.h',
224        'tests/file_utils.cc',
225        'tests/file_utils.h',
226        'windows/omap_unittest.cc',
227      ],
228      'include_dirs': [
229        '..',
230      ],
231      'dependencies': [
232        'common',
233        '../build/testing.gypi:gmock_main',
234        '../build/testing.gypi:gmock',
235        '../build/testing.gypi:gtest',
236      ],
237      'libraries': [
238        '-ldl',
239      ],
240    },
241  ],
242}
243