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 # The yasm build process creates a slew of small C subprograms that | 5 # The yasm build process creates a slew of small C subprograms that |
6 # dynamically generate files at various point in the build process. This makes | 6 # dynamically generate files at various point in the build process. This makes |
7 # the build integration moderately complex. | 7 # the build integration moderately complex. |
8 # | 8 # |
9 # There are three classes of dynamically generated files: | 9 # There are three classes of dynamically generated files: |
10 # 1) C source files that should be included in the build (eg., lc3bid.c) | 10 # 1) C source files that should be included in the build (eg., lc3bid.c) |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 "source/patched-yasm/tools/re2c/scanner.c", | 136 "source/patched-yasm/tools/re2c/scanner.c", |
137 "source/patched-yasm/tools/re2c/mbo_getopt.c", | 137 "source/patched-yasm/tools/re2c/mbo_getopt.c", |
138 "source/patched-yasm/tools/re2c/substr.c", | 138 "source/patched-yasm/tools/re2c/substr.c", |
139 "source/patched-yasm/tools/re2c/translate.c", | 139 "source/patched-yasm/tools/re2c/translate.c", |
140 ] | 140 ] |
141 | 141 |
142 configs -= [ "//build/config/compiler:chromium_code" ] | 142 configs -= [ "//build/config/compiler:chromium_code" ] |
143 configs += [ | 143 configs += [ |
144 ":yasm_config", | 144 ":yasm_config", |
145 "//build/config/compiler:no_chromium_code", | 145 "//build/config/compiler:no_chromium_code", |
| 146 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 147 "//build/config/compiler:no_size_t_to_int_warning", |
146 ] | 148 ] |
147 | 149 |
148 # re2c is missing CLOSEVOP from one switch. | 150 # re2c is missing CLOSEVOP from one switch. |
149 if (is_posix) { | 151 if (is_posix) { |
150 cflags = [ "-Wno-switch" ] | 152 cflags = [ "-Wno-switch" ] |
151 } else if (is_win) { | |
152 cflags = [ "/wd4267" ] # size_t to int conversion. | |
153 } | 153 } |
154 } | 154 } |
155 | 155 |
156 executable("yasm") { | 156 executable("yasm") { |
157 sources = [ | 157 sources = [ |
158 "source/patched-yasm/frontends/yasm/yasm-options.c", | 158 "source/patched-yasm/frontends/yasm/yasm-options.c", |
159 "source/patched-yasm/frontends/yasm/yasm.c", | 159 "source/patched-yasm/frontends/yasm/yasm.c", |
160 "source/patched-yasm/libyasm/assocdat.c", | 160 "source/patched-yasm/libyasm/assocdat.c", |
161 "source/patched-yasm/libyasm/bc-align.c", | 161 "source/patched-yasm/libyasm/bc-align.c", |
162 "source/patched-yasm/libyasm/bc-data.c", | 162 "source/patched-yasm/libyasm/bc-data.c", |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 "$target_gen_dir/lc3bid.c", | 233 "$target_gen_dir/lc3bid.c", |
234 | 234 |
235 # File generated by generate_module | 235 # File generated by generate_module |
236 "$target_gen_dir/module.c", | 236 "$target_gen_dir/module.c", |
237 ] | 237 ] |
238 | 238 |
239 configs -= [ "//build/config/compiler:chromium_code" ] | 239 configs -= [ "//build/config/compiler:chromium_code" ] |
240 configs += [ | 240 configs += [ |
241 ":yasm_config", | 241 ":yasm_config", |
242 "//build/config/compiler:no_chromium_code", | 242 "//build/config/compiler:no_chromium_code", |
| 243 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
| 244 "//build/config/compiler:no_size_t_to_int_warning", |
243 ] | 245 ] |
244 | 246 |
245 # Yasm generates a bunch of .c files which its source file #include. | 247 # Yasm generates a bunch of .c files which its source file #include. |
246 # Add the |target_gen_dir| into the include path so it can find them. | 248 # Add the |target_gen_dir| into the include path so it can find them. |
247 # Ideally, these generated .c files would be placed into a separate | 249 # Ideally, these generated .c files would be placed into a separate |
248 # directory, but the gen_x86_insn.py script does not make this easy. | 250 # directory, but the gen_x86_insn.py script does not make this easy. |
249 include_dirs = [ yasm_gen_include_dir ] | 251 include_dirs = [ yasm_gen_include_dir ] |
250 | 252 |
251 if (is_win) { | 253 if (!is_win) { |
252 cflags = [ "/wd4267" ] # size_t to int conversion. | |
253 } else { | |
254 cflags = [ | 254 cflags = [ |
255 "-ansi", | 255 "-ansi", |
256 "-pedantic", | 256 "-pedantic", |
257 ] | 257 ] |
258 if (is_clang) { | 258 if (is_clang) { |
259 cflags += [ "-Wno-incompatible-pointer-types" ] | 259 cflags += [ "-Wno-incompatible-pointer-types" ] |
260 } | 260 } |
261 } | 261 } |
262 | 262 |
263 # TODO(ajwong): This should take most of the generated output as | 263 # TODO(ajwong): This should take most of the generated output as |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 | 471 |
472 # Output eventually #included by source/patched-yasm/frontends/yasm/x86id.c | 472 # Output eventually #included by source/patched-yasm/frontends/yasm/x86id.c |
473 outputs = [ | 473 outputs = [ |
474 "$yasm_gen_include_dir/x86insns.c", | 474 "$yasm_gen_include_dir/x86insns.c", |
475 "$yasm_gen_include_dir/x86insn_gas.gperf", | 475 "$yasm_gen_include_dir/x86insn_gas.gperf", |
476 "$yasm_gen_include_dir/x86insn_nasm.gperf", | 476 "$yasm_gen_include_dir/x86insn_nasm.gperf", |
477 ] | 477 ] |
478 args = [ rebase_path(yasm_gen_include_dir, root_build_dir) ] | 478 args = [ rebase_path(yasm_gen_include_dir, root_build_dir) ] |
479 } | 479 } |
480 } | 480 } |
OLD | NEW |