summaryrefslogtreecommitdiffstats
path: root/ios/crnet/crnet_pack.gyp
blob: 81b2e78bf51c8c1172e433ce238c793748c89655 (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
# Copyright 2014 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.

{
  'variables': {
    'chromium_code': 1,
  },
  'targets': [],
  'conditions': [
    # Our shared library hack only works with ninja; xcode cannot generate
    # iOS build targets for dynamic libraries. More details below.
    ['"<(GENERATOR)"=="ninja"', {
      'targets': [
        {
          'target_name': 'crnet_dummy',
          'type': 'executable',
          'mac_bundle': 1,
          'dependencies': [
            '../../ios/crnet/crnet.gyp:crnet',
          ],
          'sources': [
            '../../ios/build/packaging/dummy_main.mm',
          ],
          'include_dirs': [
            '../..',
          ],
          'xcode_settings': {
            'INFOPLIST_FILE': '../../ios/build/packaging/dummy-Info.plist',
          },
        },
        {
          # Build this target to package a standalone CrNet in a single
          # .a file.
          'target_name': 'crnet_pack',
          'type': 'none',
          'dependencies': [
            # Depend on the dummy target so that all of CrNet's dependencies
            # are built before packaging.
            'crnet_dummy',
          ],
          'actions': [
            {
              'action_name': 'Package CrNet',
              'variables': {
                'tool_path':
                    '../../ios/build/packaging/link_dependencies.py',
              },

              # Actions need an inputs list, even if it's empty.
              'inputs': [],
              # Only specify one output, since this will be libtool's output.
              'outputs': [ '<(PRODUCT_DIR)/libcrnet_standalone.a' ],
              'action': ['<(tool_path)',
                         '<(PRODUCT_DIR)',
                         'crnet_dummy.app/crnet_dummy',
                         '<@(_outputs)',
              ],
            },
          ],
        },
      ],
    }],
  ],
}