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 29 matching lines...) Expand all Loading... |
40 include_dirs = [ | 40 include_dirs = [ |
41 "source/config/$os", | 41 "source/config/$os", |
42 "source/patched-yasm", | 42 "source/patched-yasm", |
43 ] | 43 ] |
44 source_prereqs = [ | 44 source_prereqs = [ |
45 config_makefile, | 45 config_makefile, |
46 "source/config/$os/config.h", | 46 "source/config/$os/config.h", |
47 "source/config/$os/libyasm-stdint.h", | 47 "source/config/$os/libyasm-stdint.h", |
48 ] | 48 ] |
49 defines = [ "HAVE_CONFIG_H" ] | 49 defines = [ "HAVE_CONFIG_H" ] |
50 cflags = [ "-std=gnu99" ] | 50 if (is_posix) { |
| 51 cflags = [ "-std=gnu99" ] |
| 52 } |
51 } | 53 } |
52 | 54 |
53 executable("genmacro") { | 55 executable("genmacro") { |
54 sources = [ "source/patched-yasm/tools/genmacro/genmacro.c" ] | 56 sources = [ "source/patched-yasm/tools/genmacro/genmacro.c" ] |
55 configs -= [ "//build/config/compiler:chromium_code" ] | 57 configs -= [ "//build/config/compiler:chromium_code" ] |
56 configs += [ ":yasm_config", | 58 configs += [ ":yasm_config", |
57 "//build/config/compiler:no_chromium_code" ] | 59 "//build/config/compiler:no_chromium_code" ] |
58 } | 60 } |
59 | 61 |
60 executable("genmodule") { | 62 executable("genmodule") { |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 "source/patched-yasm/tools/re2c/mbo_getopt.c", | 117 "source/patched-yasm/tools/re2c/mbo_getopt.c", |
116 "source/patched-yasm/tools/re2c/substr.c", | 118 "source/patched-yasm/tools/re2c/substr.c", |
117 "source/patched-yasm/tools/re2c/translate.c", | 119 "source/patched-yasm/tools/re2c/translate.c", |
118 ] | 120 ] |
119 | 121 |
120 configs -= [ "//build/config/compiler:chromium_code" ] | 122 configs -= [ "//build/config/compiler:chromium_code" ] |
121 configs += [ ":yasm_config", | 123 configs += [ ":yasm_config", |
122 "//build/config/compiler:no_chromium_code" ] | 124 "//build/config/compiler:no_chromium_code" ] |
123 | 125 |
124 # re2c is missing CLOSEVOP from one switch. | 126 # re2c is missing CLOSEVOP from one switch. |
125 cflags = [ "-Wno-switch" ] | 127 if (is_posix) { |
| 128 cflags = [ "-Wno-switch" ] |
| 129 } |
126 } | 130 } |
127 | 131 |
128 executable("yasm") { | 132 executable("yasm") { |
129 sources = [ | 133 sources = [ |
130 "source/patched-yasm/frontends/yasm/yasm-options.c", | 134 "source/patched-yasm/frontends/yasm/yasm-options.c", |
131 "source/patched-yasm/frontends/yasm/yasm.c", | 135 "source/patched-yasm/frontends/yasm/yasm.c", |
132 "source/patched-yasm/libyasm/assocdat.c", | 136 "source/patched-yasm/libyasm/assocdat.c", |
133 "source/patched-yasm/libyasm/bc-align.c", | 137 "source/patched-yasm/libyasm/bc-align.c", |
134 "source/patched-yasm/libyasm/bc-data.c", | 138 "source/patched-yasm/libyasm/bc-data.c", |
135 "source/patched-yasm/libyasm/bc-incbin.c", | 139 "source/patched-yasm/libyasm/bc-incbin.c", |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 configs -= [ "//build/config/compiler:chromium_code" ] | 215 configs -= [ "//build/config/compiler:chromium_code" ] |
212 configs += [ ":yasm_config", | 216 configs += [ ":yasm_config", |
213 "//build/config/compiler:no_chromium_code" ] | 217 "//build/config/compiler:no_chromium_code" ] |
214 | 218 |
215 # Yasm generates a bunch of .c files which its source file #include. | 219 # Yasm generates a bunch of .c files which its source file #include. |
216 # Add the |target_gen_dir| into the include path so it can find them. | 220 # Add the |target_gen_dir| into the include path so it can find them. |
217 # Ideally, these generated .c files would be placed into a separate | 221 # Ideally, these generated .c files would be placed into a separate |
218 # directory, but the gen_x86_insn.py script does not make this easy. | 222 # directory, but the gen_x86_insn.py script does not make this easy. |
219 include_dirs = [ yasm_gen_include_dir ] | 223 include_dirs = [ yasm_gen_include_dir ] |
220 | 224 |
221 cflags = [ "-ansi", "-pedantic" ] | 225 if (is_win) { |
222 if (is_clang) { | 226 cflags = [ "/wd4267" ] # size_t to int conversion. |
223 cflags += [ "-Wno-incompatible-pointer-types" ] | 227 } else { |
| 228 cflags = [ "-ansi", "-pedantic" ] |
| 229 if (is_clang) { |
| 230 cflags += [ "-Wno-incompatible-pointer-types" ] |
| 231 } |
224 } | 232 } |
225 | 233 |
226 # TODO(ajwong): This should take most of the generated output as | 234 # TODO(ajwong): This should take most of the generated output as |
227 # source_prereqs. | 235 # source_prereqs. |
228 deps = [ | 236 deps = [ |
229 ":compile_gperf", | 237 ":compile_gperf", |
230 ":compile_gperf_for_include", | 238 ":compile_gperf_for_include", |
231 ":compile_nasm_macros", | 239 ":compile_nasm_macros", |
232 ":compile_nasm_version", | 240 ":compile_nasm_version", |
| 241 ":compile_re2c_lc3b", |
233 ":compile_win64_gas", | 242 ":compile_win64_gas", |
234 ":compile_win64_nasm", | 243 ":compile_win64_nasm", |
235 ":compile_re2c", | 244 ":compile_re2c", |
236 ":generate_license", | 245 ":generate_license", |
237 ":generate_module", | 246 ":generate_module", |
238 ":generate_version", | 247 ":generate_version", |
239 ":yasm_utils", | 248 ":yasm_utils", |
240 ] | 249 ] |
241 } | 250 } |
242 | 251 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 script = "source/patched-yasm/modules/arch/x86/gen_x86_insn.py" | 402 script = "source/patched-yasm/modules/arch/x86/gen_x86_insn.py" |
394 # Output eventually #included by source/patched-yasm/frontends/yasm/x86id.c | 403 # Output eventually #included by source/patched-yasm/frontends/yasm/x86id.c |
395 outputs = [ | 404 outputs = [ |
396 "$yasm_gen_include_dir/x86insns.c", | 405 "$yasm_gen_include_dir/x86insns.c", |
397 "$yasm_gen_include_dir/x86insn_gas.gperf", | 406 "$yasm_gen_include_dir/x86insn_gas.gperf", |
398 "$yasm_gen_include_dir/x86insn_nasm.gperf", | 407 "$yasm_gen_include_dir/x86insn_nasm.gperf", |
399 ] | 408 ] |
400 args = [ rebase_path(yasm_gen_include_dir, root_build_dir) ] | 409 args = [ rebase_path(yasm_gen_include_dir, root_build_dir) ] |
401 } | 410 } |
402 } | 411 } |
OLD | NEW |