Upstream version 5.34.98.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / build / generate_asm_header.gypi
1 # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
2 #
3 # Use of this source code is governed by a BSD-style license
4 # that can be found in the LICENSE file in the root of the source
5 # tree. An additional intellectual property rights grant can be found
6 # in the file PATENTS.  All contributing project authors may
7 # be found in the AUTHORS file in the root of the source tree.
8
9 # This file is meant to be included into a target to provide an action
10 # to generate C header files. These headers include definitions
11 # that can be used in ARM assembly files.
12 #
13 # To use this, create a gyp target with the following form:
14 # {
15 #   'target_name': 'my_asm_headers_lib',
16 #   'type': 'static_library',
17 #   'sources': [
18 #     'foo.c',
19 #     'bar.c',
20 #   ],
21 #   'includes': ['path/to/this/gypi/file'],
22 # }
23 #
24 # The headers are guaranteed to be generated before any
25 # source files, even within this target, are compiled.
26 #
27 # The 'asm_header_dir' variable specifies the path suffix that output
28 # files are generated under.
29
30 # TODO(kma): port this block from Android into other build systems.
31 {
32   'variables': {
33     'out_dir': '<(SHARED_INTERMEDIATE_DIR)/<(asm_header_dir)',
34     'process_outputs_as_sources': 1,
35     'conditions': [
36       # We only support Android and iOS.
37       ['OS=="android"', {
38         'compiler_to_use':
39           '<!(/bin/echo -n ${ANDROID_GOMA_WRAPPER} <(android_toolchain)/*-gcc)',
40         'compiler_options': '-I<(webrtc_root)/.. -I<@(android_ndk_include) -S',
41         'pattern_to_detect': 'offset_',
42       }],
43       ['OS=="ios"', {
44         'compiler_to_use': 'clang',
45         'compiler_options':
46           '-arch armv7 -I<(webrtc_root)/.. -isysroot $(SDKROOT) -S',
47         'pattern_to_detect': '_offset_',
48       }],
49     ]
50   },
51   'rules': [
52     {
53       'rule_name': 'generate_asm_header',
54       'extension': 'c',
55       'inputs': [
56         'generate_asm_header.py',
57       ],
58       'outputs': [
59         '<(out_dir)/<(RULE_INPUT_ROOT).h',
60       ],
61       'action': [
62         'python',
63         '<(webrtc_root)/build/generate_asm_header.py',
64         '--compiler=<(compiler_to_use)',
65         '--options=<(compiler_options)',
66         '--pattern=<(pattern_to_detect)',
67         '--dir=<(out_dir)',
68         '<(RULE_INPUT_PATH)',
69       ],
70       'message': 'Generating assembly header files',
71       'process_outputs_as_sources': 1,
72     },
73   ],
74   'direct_dependent_settings': {
75     'include_dirs': ['<(out_dir)',],
76   },
77   # This target exports a hard dependency because it generates header files.
78   'hard_dependency': 1,
79 }