diff options
Diffstat (limited to 'third_party/yasm/BUILD.gn')
-rw-r--r-- | third_party/yasm/BUILD.gn | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/third_party/yasm/BUILD.gn b/third_party/yasm/BUILD.gn index fcb779a..36937b8 100644 --- a/third_party/yasm/BUILD.gn +++ b/third_party/yasm/BUILD.gn @@ -135,6 +135,20 @@ if (current_toolchain == host_toolchain) { ] } + config("re2c_warnings") { + # re2c is missing CLOSEVOP from one switch. + if (is_clang) { + cflags = [ + # re2c is missing CLOSEVOP from one switch. + "-Wno-switch", + + # re2c contains many static functions in headers (because it's + # a C library predating C99.) + "-Wno-unused-function", + ] + } + } + executable("re2c") { sources = [ "source/patched-yasm/tools/re2c/actions.c", @@ -148,23 +162,13 @@ if (current_toolchain == host_toolchain) { "source/patched-yasm/tools/re2c/translate.c", ] - config("re2c_warnings") { - # re2c is missing CLOSEVOP from one switch. - if (is_clang) { - cflags = [ - # re2c is missing CLOSEVOP from one switch. - "-Wno-switch", - - # re2c contains many static functions in headers (because it's - # a C library predating C99.) - "-Wno-unused-function", - ] - } - } configs -= [ "//build/config/compiler:chromium_code" ] configs += [ ":yasm_config", "//build/config/compiler:no_chromium_code", + + # Must be after no_chromium_code for warning flags to be ordered + # correctly. ":re2c_warnings", ] deps = [ @@ -172,6 +176,15 @@ if (current_toolchain == host_toolchain) { ] } + config("yasm_warnings") { + if (is_clang) { + cflags = [ + # reg3264type in x86expr.c is unused. + "-Wno-unused-local-typedef", + ] + } + } + executable("yasm") { sources = [ "source/patched-yasm/frontends/yasm/yasm-options.c", @@ -260,17 +273,11 @@ if (current_toolchain == host_toolchain) { ":yasm_config", "//build/config/compiler:no_chromium_code", "//build/config/compiler:no_incompatible_pointer_warnings", - ] - config("yasm_warnings") { - if (is_clang) { - cflags = [ - # reg3264type in x86expr.c is unused. - "-Wno-unused-local-typedef", - ] - } - } - configs += [ ":yasm_warnings" ] + # Must be after no_chromium_code for warning flags to be ordered + # correctly. + ":yasm_warnings", + ] # Yasm generates a bunch of .c files which its source file #include. # Add the |target_gen_dir| into the include path so it can find them. |