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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 ] | 146 ] |
147 | 147 |
148 # re2c is missing CLOSEVOP from one switch. | 148 # re2c is missing CLOSEVOP from one switch. |
149 if (is_posix) { | 149 if (is_posix) { |
150 cflags = [ "-Wno-switch" ] | 150 cflags = [ "-Wno-switch" ] |
151 } else if (is_win) { | |
152 cflags = [ "/wd4267" ] # size_t to int conversion. | |
153 } | 151 } |
154 } | 152 } |
155 | 153 |
156 executable("yasm") { | 154 executable("yasm") { |
157 sources = [ | 155 sources = [ |
158 "source/patched-yasm/frontends/yasm/yasm-options.c", | 156 "source/patched-yasm/frontends/yasm/yasm-options.c", |
159 "source/patched-yasm/frontends/yasm/yasm.c", | 157 "source/patched-yasm/frontends/yasm/yasm.c", |
160 "source/patched-yasm/libyasm/assocdat.c", | 158 "source/patched-yasm/libyasm/assocdat.c", |
161 "source/patched-yasm/libyasm/bc-align.c", | 159 "source/patched-yasm/libyasm/bc-align.c", |
162 "source/patched-yasm/libyasm/bc-data.c", | 160 "source/patched-yasm/libyasm/bc-data.c", |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 ":yasm_config", | 239 ":yasm_config", |
242 "//build/config/compiler:no_chromium_code", | 240 "//build/config/compiler:no_chromium_code", |
243 ] | 241 ] |
244 | 242 |
245 # Yasm generates a bunch of .c files which its source file #include. | 243 # 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. | 244 # 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 | 245 # 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. | 246 # directory, but the gen_x86_insn.py script does not make this easy. |
249 include_dirs = [ yasm_gen_include_dir ] | 247 include_dirs = [ yasm_gen_include_dir ] |
250 | 248 |
251 if (is_win) { | 249 if (!is_win) { |
252 cflags = [ "/wd4267" ] # size_t to int conversion. | |
253 } else { | |
254 cflags = [ | 250 cflags = [ |
255 "-ansi", | 251 "-ansi", |
256 "-pedantic", | 252 "-pedantic", |
257 ] | 253 ] |
258 if (is_clang) { | 254 if (is_clang) { |
259 cflags += [ "-Wno-incompatible-pointer-types" ] | 255 cflags += [ "-Wno-incompatible-pointer-types" ] |
260 } | 256 } |
261 } | 257 } |
262 | 258 |
263 # TODO(ajwong): This should take most of the generated output as | 259 # 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 | 467 |
472 # Output eventually #included by source/patched-yasm/frontends/yasm/x86id.c | 468 # Output eventually #included by source/patched-yasm/frontends/yasm/x86id.c |
473 outputs = [ | 469 outputs = [ |
474 "$yasm_gen_include_dir/x86insns.c", | 470 "$yasm_gen_include_dir/x86insns.c", |
475 "$yasm_gen_include_dir/x86insn_gas.gperf", | 471 "$yasm_gen_include_dir/x86insn_gas.gperf", |
476 "$yasm_gen_include_dir/x86insn_nasm.gperf", | 472 "$yasm_gen_include_dir/x86insn_nasm.gperf", |
477 ] | 473 ] |
478 args = [ rebase_path(yasm_gen_include_dir, root_build_dir) ] | 474 args = [ rebase_path(yasm_gen_include_dir, root_build_dir) ] |
479 } | 475 } |
480 } | 476 } |
OLD | NEW |