summaryrefslogtreecommitdiffstats
path: root/webkit/common/user_agent/webkit_user_agent.gyp
blob: f1f0088fca1b2290fccb2cabb4ac1ee262871ca5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

{
  'targets': [
    {
      'target_name': 'user_agent',
      'type': '<(component)',
      'defines': [
        'WEBKIT_USER_AGENT_IMPLEMENTATION',
      ],
      'variables': {
        'chromium_code': 1,
      },
      'dependencies': [
        '<(DEPTH)/base/base.gyp:base',
        '<(DEPTH)/base/base.gyp:base_i18n',
        '<(DEPTH)/build/temp_gyp/googleurl.gyp:googleurl',
      ],
      'sources': [
        'user_agent.cc',
        'user_agent.h',
        'user_agent_util.cc',
        'user_agent_util_ios.mm',
        'user_agent_util.h',
        'webkit_user_agent_export.h',
      ],
      'conditions': [
        ['OS == "ios"', {
          # iOS has different user-agent construction utilities, since the
          # version strings is not derived from webkit_version, and follows
          # a different format.
          'sources!': [
            'user_agent_util.cc',
          ],
        }, {  # OS != "ios"
          'dependencies': [
            'webkit_version',
            '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
          ],
        }],
      ],
    },
  ],
  'conditions': [
    ['OS != "ios"', {
      'targets': [
        {
          'target_name': 'webkit_version',
          'type': 'none',
          'actions': [
            {
              'action_name': 'webkit_version',
              'inputs': [
                '<(script)',
                '<(lastchange)',
                '<(template)',
              ],
              'outputs': [
                '<(SHARED_INTERMEDIATE_DIR)/webkit_version.h',
              ],
              'action': ['python',
                         '<(script)',
                         '-f', '<(lastchange)',
                         '<(template)',
                         '<@(_outputs)',
                       ],
              'variables': {
                'script': '<(DEPTH)/chrome/tools/build/version.py',
                'lastchange': '<(DEPTH)/build/util/LASTCHANGE.blink',
                'template': '<(DEPTH)/webkit/build/webkit_version.h.in',
              },
            },
          ],
          'direct_dependent_settings': {
            'include_dirs': [
              '<(SHARED_INTERMEDIATE_DIR)',
            ],
          },
          # Dependents may rely on files generated by this target or one of its
          # own hard dependencies.
          'hard_dependency': 1,
        },
      ],
    }],
  ],
}