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 yasm_os = os | 33 config_makefile = "source/config/$host_os/Makefile" |
34 if (is_chromeos) { | |
35 yasm_os = "linux" | |
36 } | |
37 config_makefile = "source/config/$yasm_os/Makefile" | |
38 version_file = "version.mac" | 34 version_file = "version.mac" |
39 | 35 |
40 import("//build/compiled_action.gni") | 36 import("//build/compiled_action.gni") |
41 | 37 |
42 config("yasm_config") { | 38 config("yasm_config") { |
43 include_dirs = [ | 39 include_dirs = [ |
44 "source/config/$yasm_os", | 40 "source/config/$host_os", |
45 "source/patched-yasm", | 41 "source/patched-yasm", |
46 ] | 42 ] |
47 defines = [ "HAVE_CONFIG_H" ] | 43 defines = [ "HAVE_CONFIG_H" ] |
48 if (is_posix) { | 44 if (is_posix) { |
49 cflags = [ "-std=gnu99" ] | 45 cflags = [ "-std=gnu99" ] |
50 } | 46 } |
51 } | 47 } |
52 | 48 |
53 executable("genmacro") { | 49 executable("genmacro") { |
54 sources = [ | 50 sources = [ |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 137 |
142 configs -= [ "//build/config/compiler:chromium_code" ] | 138 configs -= [ "//build/config/compiler:chromium_code" ] |
143 configs += [ | 139 configs += [ |
144 ":yasm_config", | 140 ":yasm_config", |
145 "//build/config/compiler:no_chromium_code", | 141 "//build/config/compiler:no_chromium_code", |
146 ] | 142 ] |
147 | 143 |
148 # re2c is missing CLOSEVOP from one switch. | 144 # re2c is missing CLOSEVOP from one switch. |
149 if (is_posix) { | 145 if (is_posix) { |
150 cflags = [ "-Wno-switch" ] | 146 cflags = [ "-Wno-switch" ] |
151 } else if (is_win) { | |
152 cflags = [ "/wd4267" ] # size_t to int conversion. | |
153 } | 147 } |
154 } | 148 } |
155 | 149 |
156 executable("yasm") { | 150 executable("yasm") { |
157 sources = [ | 151 sources = [ |
158 "source/patched-yasm/frontends/yasm/yasm-options.c", | 152 "source/patched-yasm/frontends/yasm/yasm-options.c", |
159 "source/patched-yasm/frontends/yasm/yasm.c", | 153 "source/patched-yasm/frontends/yasm/yasm.c", |
160 "source/patched-yasm/libyasm/assocdat.c", | 154 "source/patched-yasm/libyasm/assocdat.c", |
161 "source/patched-yasm/libyasm/bc-align.c", | 155 "source/patched-yasm/libyasm/bc-align.c", |
162 "source/patched-yasm/libyasm/bc-data.c", | 156 "source/patched-yasm/libyasm/bc-data.c", |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 ":yasm_config", | 235 ":yasm_config", |
242 "//build/config/compiler:no_chromium_code", | 236 "//build/config/compiler:no_chromium_code", |
243 ] | 237 ] |
244 | 238 |
245 # Yasm generates a bunch of .c files which its source file #include. | 239 # 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. | 240 # 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 | 241 # 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. | 242 # directory, but the gen_x86_insn.py script does not make this easy. |
249 include_dirs = [ yasm_gen_include_dir ] | 243 include_dirs = [ yasm_gen_include_dir ] |
250 | 244 |
251 if (is_win) { | 245 if (!is_win) { |
252 cflags = [ "/wd4267" ] # size_t to int conversion. | |
253 } else { | |
254 cflags = [ | 246 cflags = [ |
255 "-ansi", | 247 "-ansi", |
256 "-pedantic", | 248 "-pedantic", |
257 ] | 249 ] |
258 if (is_clang) { | 250 if (is_clang) { |
259 cflags += [ "-Wno-incompatible-pointer-types" ] | 251 cflags += [ "-Wno-incompatible-pointer-types" ] |
260 } | 252 } |
261 } | 253 } |
262 | 254 |
263 # TODO(ajwong): This should take most of the generated output as | 255 # 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 | 463 |
472 # Output eventually #included by source/patched-yasm/frontends/yasm/x86id.c | 464 # Output eventually #included by source/patched-yasm/frontends/yasm/x86id.c |
473 outputs = [ | 465 outputs = [ |
474 "$yasm_gen_include_dir/x86insns.c", | 466 "$yasm_gen_include_dir/x86insns.c", |
475 "$yasm_gen_include_dir/x86insn_gas.gperf", | 467 "$yasm_gen_include_dir/x86insn_gas.gperf", |
476 "$yasm_gen_include_dir/x86insn_nasm.gperf", | 468 "$yasm_gen_include_dir/x86insn_nasm.gperf", |
477 ] | 469 ] |
478 args = [ rebase_path(yasm_gen_include_dir, root_build_dir) ] | 470 args = [ rebase_path(yasm_gen_include_dir, root_build_dir) ] |
479 } | 471 } |
480 } | 472 } |
OLD | NEW |