OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 provides the yasm_assemble() template which uses YASM to assemble | 5 # This provides the yasm_assemble() template which uses YASM to assemble |
6 # assembly files. | 6 # assembly files. |
7 # | 7 # |
8 # Files to be assembled with YASM should have an extension of .asm. | 8 # Files to be assembled with YASM should have an extension of .asm. |
9 # | 9 # |
10 # Parameters | 10 # Parameters |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 assert(defined(invoker.sources), "Need sources defined for $target_name") | 103 assert(defined(invoker.sources), "Need sources defined for $target_name") |
104 | 104 |
105 # Only depend on YASM on x86 systems. Force compilation of .asm files for | 105 # Only depend on YASM on x86 systems. Force compilation of .asm files for |
106 # ARM to fail. | 106 # ARM to fail. |
107 assert(cpu_arch == "x86" || cpu_arch == "x64") | 107 assert(cpu_arch == "x86" || cpu_arch == "x64") |
108 | 108 |
109 action_name = "${target_name}_action" | 109 action_name = "${target_name}_action" |
110 source_set_name = target_name | 110 source_set_name = target_name |
111 | 111 |
112 action_foreach(action_name) { | 112 action_foreach(action_name) { |
113 visibility = ":$source_set_name" # Only the source set can depend on this. | 113 # Only the source set can depend on this. |
| 114 visibility = [ ":$source_set_name" ] |
114 | 115 |
115 script = "//third_party/yasm/run_yasm.py" | 116 script = "//third_party/yasm/run_yasm.py" |
116 sources = invoker.sources | 117 sources = invoker.sources |
117 | 118 |
118 if (defined(invoker.inputs)) { | 119 if (defined(invoker.inputs)) { |
119 inputs = invoker.inputs | 120 inputs = invoker.inputs |
120 } | 121 } |
121 | 122 |
122 # Executable (first in the args). The binary might be in the root build dir | 123 # Executable (first in the args). The binary might be in the root build dir |
123 # (no cross-compiling) or in a toolchain-specific subdirectory of that | 124 # (no cross-compiling) or in a toolchain-specific subdirectory of that |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 source_set(source_set_name) { | 179 source_set(source_set_name) { |
179 if (defined(invoker.visibility)) { | 180 if (defined(invoker.visibility)) { |
180 visibility = invoker.visibility | 181 visibility = invoker.visibility |
181 } | 182 } |
182 | 183 |
183 sources = get_target_outputs(":$action_name") | 184 sources = get_target_outputs(":$action_name") |
184 | 185 |
185 deps = [ ":$action_name" ] | 186 deps = [ ":$action_name" ] |
186 } | 187 } |
187 } | 188 } |
OLD | NEW |