summaryrefslogtreecommitdiffstats
path: root/chromium/build/toolchain/win/tool_wrapper.py
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/build/toolchain/win/tool_wrapper.py')
-rw-r--r--chromium/build/toolchain/win/tool_wrapper.py37
1 files changed, 1 insertions, 36 deletions
diff --git a/chromium/build/toolchain/win/tool_wrapper.py b/chromium/build/toolchain/win/tool_wrapper.py
index 3834cf2c01a..e5cc81b1fde 100644
--- a/chromium/build/toolchain/win/tool_wrapper.py
+++ b/chromium/build/toolchain/win/tool_wrapper.py
@@ -212,46 +212,11 @@ class WinTool(object):
def ExecRcWrapper(self, arch, *args):
"""Converts .rc files to .res files."""
env = self._GetEnv(arch)
-
- # We run two resource compilers:
- # 1. A custom one at build/toolchain/win/rc/rc.py which can run on
- # non-Windows, and which has /showIncludes support so we can track
- # dependencies (e.g. on .ico files) of .rc files.
- # 2. On Windows, regular Microsoft rc.exe, to make sure rc.py produces
- # bitwise identical output.
-
- # 1. Run our rc.py.
- # Also pass /showIncludes to track dependencies of .rc files.
args = list(args)
rcpy_args = args[:]
rcpy_args[0:1] = [sys.executable, os.path.join(BASE_DIR, 'rc', 'rc.py')]
- rcpy_res_output = rcpy_args[-2]
- assert rcpy_res_output.startswith('/fo')
- assert rcpy_res_output.endswith('.res')
- rc_res_output = rcpy_res_output + '_ms_rc'
- args[-2] = rc_res_output
rcpy_args.append('/showIncludes')
- rc_exe_exit_code = subprocess.call(rcpy_args, env=env)
- if rc_exe_exit_code == 0:
- # Since tool("rc") can't have deps, add deps on this script and on rc.py
- # and its deps here, so that rc edges become dirty if rc.py changes.
- print('Note: including file: ../../build/toolchain/win/tool_wrapper.py')
- print('Note: including file: ../../build/toolchain/win/rc/rc.py')
- print(
- 'Note: including file: ../../build/toolchain/win/rc/linux64/rc.sha1')
- print('Note: including file: ../../build/toolchain/win/rc/mac/rc.sha1')
- print(
- 'Note: including file: ../../build/toolchain/win/rc/win/rc.exe.sha1')
-
- # 2. Run Microsoft rc.exe.
- if sys.platform == 'win32' and rc_exe_exit_code == 0:
- rc_exe_exit_code = subprocess.call(args, shell=True, env=env)
- # Assert Microsoft rc.exe and rc.py produced identical .res files.
- if rc_exe_exit_code == 0:
- import filecmp
- # Strip "/fo" prefix.
- assert filecmp.cmp(rc_res_output[3:], rcpy_res_output[3:])
- return rc_exe_exit_code
+ return subprocess.call(rcpy_args, env=env)
def ExecActionWrapper(self, arch, rspfile, *dirname):
"""Runs an action command line from a response file using the environment