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 12 matching lines...) Expand all Loading... |
23 # shared between yasm and the genperf subprogram. | 23 # shared between yasm and the genperf subprogram. |
24 # 4) genmacro, genmodule, etc. -- One executable target for each subprogram. | 24 # 4) genmacro, genmodule, etc. -- One executable target for each subprogram. |
25 # 5) generate_license, generate_module, etc. -- Actions that invoke programs | 25 # 5) generate_license, generate_module, etc. -- Actions that invoke programs |
26 # built in #4 to generate .c files. | 26 # built in #4 to generate .c files. |
27 # 6) compile_gperf, compile_re2c, etc. -- Actions that invoke programs that | 27 # 6) compile_gperf, compile_re2c, etc. -- Actions that invoke programs that |
28 # turn intermediate files into .c files. | 28 # turn intermediate files into .c files. |
29 | 29 |
30 if (current_toolchain == host_toolchain) { | 30 if (current_toolchain == host_toolchain) { |
31 # Various files referenced by multiple targets. | 31 # Various files referenced by multiple targets. |
32 yasm_gen_include_dir = "$target_gen_dir/include" | 32 yasm_gen_include_dir = "$target_gen_dir/include" |
33 config_makefile = "source/config/$host_os/Makefile" | 33 yasm_os = os |
| 34 if (is_chromeos) { |
| 35 yasm_os = "linux" |
| 36 } |
| 37 config_makefile = "source/config/$yasm_os/Makefile" |
34 version_file = "version.mac" | 38 version_file = "version.mac" |
35 | 39 |
36 import("//build/compiled_action.gni") | 40 import("//build/compiled_action.gni") |
37 | 41 |
38 config("yasm_config") { | 42 config("yasm_config") { |
39 include_dirs = [ | 43 include_dirs = [ |
40 "source/config/$host_os", | 44 "source/config/$yasm_os", |
41 "source/patched-yasm", | 45 "source/patched-yasm", |
42 ] | 46 ] |
43 defines = [ "HAVE_CONFIG_H" ] | 47 defines = [ "HAVE_CONFIG_H" ] |
44 if (is_posix) { | 48 if (is_posix) { |
45 cflags = [ "-std=gnu99" ] | 49 cflags = [ "-std=gnu99" ] |
46 } | 50 } |
47 } | 51 } |
48 | 52 |
49 executable("genmacro") { | 53 executable("genmacro") { |
50 sources = [ | 54 sources = [ |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 141 |
138 configs -= [ "//build/config/compiler:chromium_code" ] | 142 configs -= [ "//build/config/compiler:chromium_code" ] |
139 configs += [ | 143 configs += [ |
140 ":yasm_config", | 144 ":yasm_config", |
141 "//build/config/compiler:no_chromium_code", | 145 "//build/config/compiler:no_chromium_code", |
142 ] | 146 ] |
143 | 147 |
144 # re2c is missing CLOSEVOP from one switch. | 148 # re2c is missing CLOSEVOP from one switch. |
145 if (is_posix) { | 149 if (is_posix) { |
146 cflags = [ "-Wno-switch" ] | 150 cflags = [ "-Wno-switch" ] |
| 151 } else if (is_win) { |
| 152 cflags = [ "/wd4267" ] # size_t to int conversion. |
147 } | 153 } |
148 } | 154 } |
149 | 155 |
150 executable("yasm") { | 156 executable("yasm") { |
151 sources = [ | 157 sources = [ |
152 "source/patched-yasm/frontends/yasm/yasm-options.c", | 158 "source/patched-yasm/frontends/yasm/yasm-options.c", |
153 "source/patched-yasm/frontends/yasm/yasm.c", | 159 "source/patched-yasm/frontends/yasm/yasm.c", |
154 "source/patched-yasm/libyasm/assocdat.c", | 160 "source/patched-yasm/libyasm/assocdat.c", |
155 "source/patched-yasm/libyasm/bc-align.c", | 161 "source/patched-yasm/libyasm/bc-align.c", |
156 "source/patched-yasm/libyasm/bc-data.c", | 162 "source/patched-yasm/libyasm/bc-data.c", |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 ":yasm_config", | 241 ":yasm_config", |
236 "//build/config/compiler:no_chromium_code", | 242 "//build/config/compiler:no_chromium_code", |
237 ] | 243 ] |
238 | 244 |
239 # Yasm generates a bunch of .c files which its source file #include. | 245 # Yasm generates a bunch of .c files which its source file #include. |
240 # Add the |target_gen_dir| into the include path so it can find them. | 246 # Add the |target_gen_dir| into the include path so it can find them. |
241 # Ideally, these generated .c files would be placed into a separate | 247 # Ideally, these generated .c files would be placed into a separate |
242 # directory, but the gen_x86_insn.py script does not make this easy. | 248 # directory, but the gen_x86_insn.py script does not make this easy. |
243 include_dirs = [ yasm_gen_include_dir ] | 249 include_dirs = [ yasm_gen_include_dir ] |
244 | 250 |
245 if (!is_win) { | 251 if (is_win) { |
| 252 cflags = [ "/wd4267" ] # size_t to int conversion. |
| 253 } else { |
246 cflags = [ | 254 cflags = [ |
247 "-ansi", | 255 "-ansi", |
248 "-pedantic", | 256 "-pedantic", |
249 ] | 257 ] |
250 if (is_clang) { | 258 if (is_clang) { |
251 cflags += [ "-Wno-incompatible-pointer-types" ] | 259 cflags += [ "-Wno-incompatible-pointer-types" ] |
252 } | 260 } |
253 } | 261 } |
254 | 262 |
255 # 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... |
463 | 471 |
464 # Output eventually #included by source/patched-yasm/frontends/yasm/x86id.c | 472 # Output eventually #included by source/patched-yasm/frontends/yasm/x86id.c |
465 outputs = [ | 473 outputs = [ |
466 "$yasm_gen_include_dir/x86insns.c", | 474 "$yasm_gen_include_dir/x86insns.c", |
467 "$yasm_gen_include_dir/x86insn_gas.gperf", | 475 "$yasm_gen_include_dir/x86insn_gas.gperf", |
468 "$yasm_gen_include_dir/x86insn_nasm.gperf", | 476 "$yasm_gen_include_dir/x86insn_nasm.gperf", |
469 ] | 477 ] |
470 args = [ rebase_path(yasm_gen_include_dir, root_build_dir) ] | 478 args = [ rebase_path(yasm_gen_include_dir, root_build_dir) ] |
471 } | 479 } |
472 } | 480 } |
OLD | NEW |