| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 is an gyp include to use YASM for compiling assembly files. | 5 # This is an gyp include to use YASM for compiling assembly files. |
| 6 # | 6 # |
| 7 # Files to be compiled with YASM should have an extension of .asm. | 7 # Files to be compiled with YASM should have an extension of .asm. |
| 8 # | 8 # |
| 9 # There are two variables for this include: | 9 # There are three variables for this include: |
| 10 # yasm_flags : Pass additional flags into YASM. | 10 # yasm_flags : Pass additional flags into YASM. |
| 11 # yasm_output_path : Output directory for the compiled object files. | 11 # yasm_output_path : Output directory for the compiled object files. |
| 12 # yasm_includes : Includes used by .asm code. Changes to which should force |
| 13 # recompilation. |
| 12 # | 14 # |
| 13 # Sample usage: | 15 # Sample usage: |
| 14 # 'sources': [ | 16 # 'sources': [ |
| 15 # 'ultra_optimized_awesome.asm', | 17 # 'ultra_optimized_awesome.asm', |
| 16 # ], | 18 # ], |
| 17 # 'variables': { | 19 # 'variables': { |
| 18 # 'yasm_flags': [ | 20 # 'yasm_flags': [ |
| 19 # '-I', 'assembly_include', | 21 # '-I', 'assembly_include', |
| 20 # ], | 22 # ], |
| 21 # 'yasm_output_path': '<(SHARED_INTERMEDIATE_DIR)/project', | 23 # 'yasm_output_path': '<(SHARED_INTERMEDIATE_DIR)/project', |
| 24 # 'yasm_includes': ['ultra_optimized_awesome.inc'] |
| 22 # }, | 25 # }, |
| 23 # 'includes': [ | 26 # 'includes': [ |
| 24 # 'third_party/yasm/yasm_compile.gypi' | 27 # 'third_party/yasm/yasm_compile.gypi' |
| 25 # ], | 28 # ], |
| 26 | 29 |
| 27 { | 30 { |
| 28 'variables': { | 31 'variables': { |
| 29 'yasm_flags': [], | 32 'yasm_flags': [], |
| 33 'yasm_includes': [], |
| 30 | 34 |
| 31 'conditions': [ | 35 'conditions': [ |
| 32 [ 'use_system_yasm==0', { | 36 [ 'use_system_yasm==0', { |
| 33 'yasm_path': '<(PRODUCT_DIR)/yasm<(EXECUTABLE_SUFFIX)', | 37 'yasm_path': '<(PRODUCT_DIR)/yasm<(EXECUTABLE_SUFFIX)', |
| 34 }, { | 38 }, { |
| 35 'yasm_path': '<!(which yasm)', | 39 'yasm_path': '<!(which yasm)', |
| 36 }], | 40 }], |
| 37 | 41 |
| 38 # Define yasm_flags that pass into YASM. | 42 # Define yasm_flags that pass into YASM. |
| 39 [ 'os_posix==1 and OS!="mac" and target_arch=="ia32"', { | 43 [ 'os_posix==1 and OS!="mac" and target_arch=="ia32"', { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 'dependencies': [ | 95 'dependencies': [ |
| 92 '<(DEPTH)/third_party/yasm/yasm.gyp:yasm#host', | 96 '<(DEPTH)/third_party/yasm/yasm.gyp:yasm#host', |
| 93 ], | 97 ], |
| 94 }], | 98 }], |
| 95 ], # conditions | 99 ], # conditions |
| 96 | 100 |
| 97 'rules': [ | 101 'rules': [ |
| 98 { | 102 { |
| 99 'rule_name': 'assemble', | 103 'rule_name': 'assemble', |
| 100 'extension': 'asm', | 104 'extension': 'asm', |
| 101 'inputs': [ '<(yasm_path)', ], | 105 'inputs': [ '<(yasm_path)', '<@(yasm_includes)'], |
| 102 'outputs': [ | 106 'outputs': [ |
| 103 '<(yasm_output_path)/<(RULE_INPUT_ROOT).<(asm_obj_extension)', | 107 '<(yasm_output_path)/<(RULE_INPUT_ROOT).<(asm_obj_extension)', |
| 104 ], | 108 ], |
| 105 'action': [ | 109 'action': [ |
| 106 '<(yasm_path)', | 110 '<(yasm_path)', |
| 107 '<@(yasm_flags)', | 111 '<@(yasm_flags)', |
| 108 '-o', '<(yasm_output_path)/<(RULE_INPUT_ROOT).<(asm_obj_extension)', | 112 '-o', '<(yasm_output_path)/<(RULE_INPUT_ROOT).<(asm_obj_extension)', |
| 109 '<(RULE_INPUT_PATH)', | 113 '<(RULE_INPUT_PATH)', |
| 110 ], | 114 ], |
| 111 'process_outputs_as_sources': 1, | 115 'process_outputs_as_sources': 1, |
| 112 'message': 'Compile assembly <(RULE_INPUT_PATH).', | 116 'message': 'Compile assembly <(RULE_INPUT_PATH).', |
| 113 }, | 117 }, |
| 114 ], # rules | 118 ], # rules |
| 115 } | 119 } |
| OLD | NEW |