summaryrefslogtreecommitdiff
path: root/chromium/build/android/pack_relocations.gypi
blob: 61b4e2c47045234eae7b6769aaa66961c6ae5e06 (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
# 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.

# This file is meant to be included into an action to provide a rule that
# packs relocations in Release builds of native libraries.
#
# To use this, create a gyp target with the following form:
#  {
#    'action_name': 'pack_relocations',
#    'actions': [
#      'variables': {
#        'enable_packing': 'pack relocations if 1, plain file copy if 0'
#        'exclude_packing_list': 'names of libraries explicitly not packed',
#        'ordered_libraries_file': 'file generated by write_ordered_libraries'
#        'input_paths': 'files to be added to the list of inputs'
#        'stamp': 'file to touch when the action is complete'
#        'stripped_libraries_dir': 'directory holding stripped libraries',
#        'packed_libraries_dir': 'directory holding packed libraries',
#      'includes': [ '../../build/android/pack_relocations.gypi' ],
#    ],
#  },
#

{
  'variables': {
    'input_paths': [],
  },
  'inputs': [
    '<(DEPTH)/build/android/gyp/util/build_utils.py',
    '<(DEPTH)/build/android/gyp/pack_relocations.py',
    '<(ordered_libraries_file)',
    '>@(input_paths)',
  ],
  'outputs': [
    '<(stamp)',
  ],
  'conditions': [
    ['enable_packing == 1', {
      'message': 'Packing relocations for <(_target_name)',
      'dependencies': [
        '<(DEPTH)/third_party/android_platform/relocation_packer.gyp:android_relocation_packer#host',
      ],
      'inputs': [
        '<(PRODUCT_DIR)/android_relocation_packer',
      ],
      'action': [
        'python', '<(DEPTH)/build/android/gyp/pack_relocations.py',
        '--configuration-name=<(CONFIGURATION_NAME)',
        '--enable-packing=1',
        '--exclude-packing-list=<@(exclude_packing_list)',
        '--android-pack-relocations=<(PRODUCT_DIR)/android_relocation_packer',
        '--stripped-libraries-dir=<(stripped_libraries_dir)',
        '--packed-libraries-dir=<(packed_libraries_dir)',
        '--libraries=@FileArg(<(ordered_libraries_file):libraries)',
        '--stamp=<(stamp)',
      ],
    }, {
      'message': 'Copying libraries (no relocation packing) for <(_target_name)',
      'action': [
        'python', '<(DEPTH)/build/android/gyp/pack_relocations.py',
        '--configuration-name=<(CONFIGURATION_NAME)',
        '--enable-packing=0',
        '--stripped-libraries-dir=<(stripped_libraries_dir)',
        '--packed-libraries-dir=<(packed_libraries_dir)',
        '--libraries=@FileArg(<(ordered_libraries_file):libraries)',
        '--stamp=<(stamp)',
      ],
    }],
    ['android_must_copy_system_libraries == 1', {
      # Add a fake output to force the build to always re-run this step. This
      # is required because the real inputs are not known at gyp-time and
      # changing base.so may not trigger changes to dependent libraries.
      'outputs': [ '<(stamp).fake' ]
    }],
  ],
}