| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # This file is meant to be included into a target to provide a rule | 5 # This file is meant to be included into a target to provide a rule |
| 6 # to strip and place dependent shared libraries required by a native binary in a | 6 # to strip and place dependent shared libraries required by a native binary in a |
| 7 # single folder that can later be pushed to the device. | 7 # single folder that can later be pushed to the device. |
| 8 # | 8 # |
| 9 # NOTE: consider packaging your binary as an apk instead of running a native | 9 # NOTE: consider packaging your binary as an apk instead of running a native |
| 10 # library. | 10 # library. |
| 11 # | 11 # |
| 12 # To use this, create a gyp target with the following form: | 12 # To use this, create a gyp target with the following form: |
| 13 # { | 13 # { |
| 14 # 'target_name': 'target_that_depends_on_my_binary', | 14 # 'target_name': 'target_that_depends_on_my_binary', |
| 15 # 'type': 'none', | 15 # 'type': 'none', |
| 16 # 'dependencies': [ | 16 # 'dependencies': [ |
| 17 # 'my_binary', | 17 # 'my_binary', |
| 18 # ], | 18 # ], |
| 19 # 'variables': { | 19 # 'variables': { |
| 20 # 'native_binary': '<(PRODUCT_DIR)/my_binary', | 20 # 'native_binary': '<(PRODUCT_DIR)/my_binary', |
| 21 # 'output_dir': 'location to place binary and dependent libraries' | 21 # 'output_dir': 'location to place binary and dependent libraries' |
| 22 # }, | 22 # }, |
| 23 # 'includes': [ '../../build/android/native_app_dependencies.gypi' ], | 23 # 'includes': [ '../../build/android/native_app_dependencies.gypi' ], |
| 24 # }, | 24 # }, |
| 25 # | 25 # |
| 26 | 26 |
| 27 { | 27 { |
| 28 'variables': { | |
| 29 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)', | |
| 30 'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json', | |
| 31 'stripped_libraries_dir%': '<(output_dir)', | |
| 32 'strip_stamp': '<(intermediate_dir)/strip.stamp', | |
| 33 }, | |
| 34 'copies': [ | 28 'copies': [ |
| 35 { | 29 { |
| 36 'destination': '<(output_dir)', | 30 'destination': '<(output_dir)', |
| 37 'files': [ '<(native_binary)' ], | 31 'files': [ '<(native_binary)' ], |
| 38 } | 32 } |
| 39 ], | 33 ], |
| 40 'conditions': [ | 34 'conditions': [ |
| 41 ['component == "shared_library"', { | 35 ['component == "shared_library"', { |
| 42 'dependencies': [ | 36 'dependencies': [ |
| 43 '<(DEPTH)/build/android/setup.gyp:copy_system_libraries', | 37 '<(DEPTH)/build/android/setup.gyp:copy_system_libraries', |
| 44 ], | 38 ], |
| 45 'variables': { | 39 'variables': { |
| 46 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)', | 40 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)', |
| 47 'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json', | 41 'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json', |
| 48 'stripped_libraries_dir%': '<(output_dir)', | |
| 49 'strip_stamp': '<(intermediate_dir)/strip.stamp', | |
| 50 }, | 42 }, |
| 51 'actions': [ | 43 'actions': [ |
| 52 { | 44 { |
| 53 'variables': { | 45 'variables': { |
| 54 'input_libraries': ['<(native_binary)'], | 46 'input_libraries': ['<(native_binary)'], |
| 55 }, | 47 }, |
| 56 'includes': ['../../build/android/write_ordered_libraries.gypi'], | 48 'includes': ['../../build/android/write_ordered_libraries.gypi'], |
| 57 }, | 49 }, |
| 58 { | 50 { |
| 51 'action_name': 'stripping native libraries', |
| 59 'variables': { | 52 'variables': { |
| 53 'stripped_libraries_dir%': '<(output_dir)', |
| 60 'input_paths': ['<(native_binary)'], | 54 'input_paths': ['<(native_binary)'], |
| 55 'stamp': '<(intermediate_dir)/strip.stamp', |
| 61 }, | 56 }, |
| 62 'includes': ['../../build/android/strip_native_libraries.gypi'], | 57 'includes': ['../../build/android/strip_native_libraries.gypi'], |
| 63 }, | 58 }, |
| 64 ], | 59 ], |
| 65 }], | 60 }], |
| 66 ], | 61 ], |
| 67 } | 62 } |
| OLD | NEW |