OLD | NEW |
---|---|
(Empty) | |
1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 # This is an gyp include to use YASM for compiling assembly files. | |
6 # | |
7 # Files to be compiled with YASM should have an extension of .asm. | |
8 # | |
9 # There are two variables for this include: | |
10 # yasm_flags : Pass additional flags into YASM. | |
11 # yasm_output_path : Output directory for the compiled object files. | |
12 # | |
13 # Sample usage: | |
14 # 'sources': [ | |
15 # 'ultra_optimized_awsome.asm', | |
scherkus (not reviewing)
2011/09/06 16:51:13
awsome -> awesome :)
Alpha Left Google
2011/09/06 17:12:13
Done.
| |
16 # ], | |
17 # 'variables': { | |
18 # 'yasm_flags': [ | |
scherkus (not reviewing)
2011/09/06 16:51:13
does including a gypi do a dictionary merge or a c
Alpha Left Google
2011/09/06 17:12:13
It'll be a merge.
| |
19 # '-I', 'assembly_include', | |
20 # ], | |
21 # 'yasm_output_path': '<(SHARED_INTERMEDIATE_DIR)/project', | |
22 # }, | |
23 # 'includes': [ | |
24 # 'third_party/yasm/yasm_compile.gypi' | |
25 # ], | |
26 | |
27 { | |
28 'variables': { | |
29 'yasm_path': '<(PRODUCT_DIR)/yasm', | |
30 'conditions': [ | |
31 # Define yasm_flags that pass into YASM. | |
32 [ 'OS=="linux" and target_arch=="ia32"', { | |
33 'yasm_flags': [ | |
34 '-felf32', | |
35 '-m', 'x86', | |
36 ], | |
37 }], | |
38 [ 'OS=="linux" and target_arch=="x64"', { | |
39 'yasm_flags': [ | |
40 '-DPIC', | |
41 '-felf64', | |
42 '-m', 'amd64', | |
43 ], | |
44 }], | |
45 [ 'OS=="mac" and target_arch=="ia32"', { | |
46 'yasm_flags': [ | |
47 '-fmacho32', | |
48 '-m', 'x86', | |
49 ], | |
50 }], | |
51 [ 'OS=="win" and target_arch=="ia32"', { | |
52 'yasm_flags': [ | |
53 '-DPREFIX', | |
54 '-fwin32', | |
55 '-m', 'x86', | |
56 ], | |
57 }], | |
58 | |
59 # Define output extension. | |
60 ['OS=="mac" or OS=="linux"', { | |
61 'asm_obj_extension': 'o', | |
62 }], | |
63 ['OS=="win"', { | |
64 'asm_obj_extension': 'obj', | |
65 }], | |
66 ], | |
67 }, # variables | |
68 | |
69 'conditions': [ | |
70 # Only depend on YASM on x86 systems, do this so that compiling | |
71 # .asm files for ARM will fail. | |
scherkus (not reviewing)
2011/09/06 16:51:13
interesting... I thought we were using YASM for AR
Alpha Left Google
2011/09/06 17:12:13
YASM doesn't compile ARM code, it's for x86 only.
| |
72 ['target_arch=="ia32" or target_arch=="x64"', { | |
73 'dependencies': [ | |
74 '<(DEPTH)/third_party/yasm/yasm.gyp:yasm#host', | |
75 ], | |
76 }], | |
77 ], # conditions | |
78 | |
79 'rules': [ | |
80 { | |
81 'rule_name': 'assemble', | |
82 'extension': 'asm', | |
83 'inputs': [ '<(yasm_path)', ], | |
84 'outputs': [ | |
85 '<(yasm_output_path)/<(RULE_INPUT_ROOT).<(asm_obj_extension)', | |
86 ], | |
87 'action': [ | |
88 '<(yasm_path)', | |
89 '<@(yasm_flags)', | |
90 '-o', '<(yasm_output_path)/<(RULE_INPUT_ROOT).<(asm_obj_extension)', | |
91 '<(RULE_INPUT_PATH)', | |
92 ], | |
93 'process_outputs_as_sources': 1, | |
94 'message': 'Compile assemly <(RULE_INPUT_PATH).', | |
95 }, | |
96 ], # rules | |
97 } | |
OLD | NEW |