From 0a3a9020b9953a9e4febd018581372b0af402cd2 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Sat, 6 Jan 2024 02:16:33 +0000 Subject: [PATCH] Move the sed in place edit flag outside the gcc_toolchain template This avoids GN warnings in targets such as Wasm where this variable is never used. --- build/toolchain/gcc_toolchain.gni | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni index a87b58ba70..e73b1f89d5 100644 --- a/build/toolchain/gcc_toolchain.gni +++ b/build/toolchain/gcc_toolchain.gni @@ -12,6 +12,13 @@ analyzer_wrapper = rebase_path("//build/toolchain/clang_static_analyzer_wrapper.py", root_build_dir) + " --mode=clang" +# Flag passed to sed to edit files in place +if (host_os == "mac") { + sed_in_place_flag = "-i ''" +} else { + sed_in_place_flag = "-i" +} + # This template defines a toolchain for something that works like gcc # (including clang). # @@ -122,12 +129,6 @@ template("gcc_toolchain") { coverage_flags = "-fprofile-instr-generate -fcoverage-mapping" } - if (host_os == "mac") { - sed_in_place_flag = "-i ''" - } else { - sed_in_place_flag = "-i" - } - tool("cc") { depfile = "{{output}}.d" command = "$cc -MD -MF $depfile {{defines}} {{include_dirs}} {{cflags}} {{cflags_c}} $coverage_flags -c {{source}} -o {{output}}"