Commit e874adda authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

win: Pass /nologo to rc.exe, simplify wrapper code a bit.

We used to have a comment saying "Older versions of RC don't support the
/nologo flag", but since we've been requiring MSVC 2017 for a long time now,
using `rc /nologo` should be safe by now.

No intended behavior change.

Bug: none
Change-Id: If13d1d3fc4647daada3af5ade526e6f774a9fb7c
Reviewed-on: https://chromium-review.googlesource.com/c/1303882Reviewed-by: default avatarScott Graham <scottmg@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#603534}
parent 6a285c4f
...@@ -198,7 +198,7 @@ template("msvc_toolchain") { ...@@ -198,7 +198,7 @@ template("msvc_toolchain") {
} }
tool("rc") { tool("rc") {
command = "$python_path $tool_wrapper_path rc-wrapper $env rc.exe {{defines}} {{include_dirs}} /fo{{output}} {{source}}" command = "$python_path $tool_wrapper_path rc-wrapper $env rc.exe /nologo {{defines}} {{include_dirs}} /fo{{output}} {{source}}"
depsformat = "msvc" depsformat = "msvc"
outputs = [ outputs = [
"$object_subdir/{{source_name_part}}.res", "$object_subdir/{{source_name_part}}.res",
......
...@@ -11,6 +11,7 @@ options: ...@@ -11,6 +11,7 @@ options:
-I<dir> Add include path. -I<dir> Add include path.
-D<sym> Define a macro for the preprocessor. -D<sym> Define a macro for the preprocessor.
/fo<out> Set path of output .res file. /fo<out> Set path of output .res file.
/nologo Ignored (rc.py doesn't print a logo by default).
/showIncludes Print referenced header and resource files.""" /showIncludes Print referenced header and resource files."""
from __future__ import print_function from __future__ import print_function
...@@ -51,6 +52,8 @@ def ParseFlags(): ...@@ -51,6 +52,8 @@ def ParseFlags():
file=sys.stderr) file=sys.stderr)
sys.exit(1) sys.exit(1)
output = flag[3:] output = flag[3:]
elif flag == '/nologo':
pass
elif flag == '/showIncludes': elif flag == '/showIncludes':
show_includes = True show_includes = True
elif (flag.startswith('-') or elif (flag.startswith('-') or
......
...@@ -215,18 +215,7 @@ class WinTool(object): ...@@ -215,18 +215,7 @@ class WinTool(object):
# 2. Run Microsoft rc.exe. # 2. Run Microsoft rc.exe.
if sys.platform == 'win32' and rc_exe_exit_code == 0: if sys.platform == 'win32' and rc_exe_exit_code == 0:
popen = subprocess.Popen(args, shell=True, env=env, rc_exe_exit_code = subprocess.call(args, shell=True, env=env)
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
out, _ = popen.communicate()
# Filter logo banner from invocations of rc.exe. Older versions of RC
# don't support the /nologo flag.
for line in out.splitlines():
if (not line.startswith('Microsoft (R) Windows (R) Resource Compiler')
and not line.startswith('Copy' + 'right (C' +
') Microsoft Corporation')
and line):
print line
rc_exe_exit_code = popen.returncode
# Assert Microsoft rc.exe and rc.py produced identical .res files. # Assert Microsoft rc.exe and rc.py produced identical .res files.
if rc_exe_exit_code == 0: if rc_exe_exit_code == 0:
import filecmp import filecmp
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment