1# Copyright 2013 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': 'device_usb',
12      'type': 'static_library',
13      'dependencies': [
14        '../../third_party/libusb/libusb.gyp:libusb',
15      ],
16      'include_dirs': [
17        '../..',
18      ],
19      'sources': [
20        'usb_context.cc',
21        'usb_context.h',
22        'usb_descriptors.cc',
23        'usb_descriptors.h',
24        'usb_device_impl.cc',
25        'usb_device_impl.h',
26        'usb_device.h',
27        'usb_device_filter.cc',
28        'usb_device_filter.h',
29        'usb_device_handle_impl.cc',
30        'usb_device_handle_impl.h',
31        'usb_device_handle.h',
32        'usb_error.cc',
33        'usb_error.h',
34        'usb_ids.cc',
35        'usb_ids.h',
36        'usb_service.h',
37        'usb_service_impl.cc',
38      ],
39      'actions': [
40        {
41          'action_name': 'generate_usb_ids',
42          'variables': {
43            'usb_ids_path%': '../../third_party/usb_ids/usb.ids',
44            'usb_ids_py_path': 'tools/usb_ids.py',
45          },
46          'inputs': [
47            '<(usb_ids_path)',
48            '<(usb_ids_py_path)',
49          ],
50          'outputs': [
51            '<(SHARED_INTERMEDIATE_DIR)/device/usb/usb_ids_gen.cc',
52          ],
53          'action': [
54            'python',
55            '<(usb_ids_py_path)',
56            '-i', '<(usb_ids_path)',
57            '-o', '<@(_outputs)',
58          ],
59          'process_outputs_as_sources': 1,
60        },
61      ],
62      'conditions': [
63        ['use_udev == 1', {
64          'dependencies': [
65            '../../build/linux/system.gyp:udev',
66          ],
67        }],
68        ['chromeos==1', {
69          'dependencies': [
70            '../../chromeos/chromeos.gyp:chromeos',
71          ],
72        }],
73      ]
74    },
75  ],
76}
77