Commit 39afaf98 authored by Yngve N. Pettersen's avatar Yngve N. Pettersen Committed by Commit Bot

Make rc.py generated ninja dependency outputs independent of where the

root output directory is actually located.

The existing fixed paths assumed the out dir is located in the chromium
src directory. Downstream projects may have their out directory located
elsewhere, for example in the chromium src dir's parent dir.

This CL calculates the relative path between the out directory and the
tool base directory, and uses that to generate the paths in the
dependency notes.

Change-Id: Ie584c3133baeaba1f2b18225a9a7e6501fce6dc1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1879457
Commit-Queue: Yngve Pettersen <yngve@vivaldi.com>
Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#709847}
parent 5f37956c
...@@ -180,15 +180,16 @@ def RunRc(preprocessed_output, is_utf8, flags): ...@@ -180,15 +180,16 @@ def RunRc(preprocessed_output, is_utf8, flags):
p.communicate(input=preprocessed_output) p.communicate(input=preprocessed_output)
if flags.show_includes and p.returncode == 0: if flags.show_includes and p.returncode == 0:
TOOL_DIR = os.path.dirname(os.path.relpath(THIS_DIR)).replace("\\", "/")
# Since tool("rc") can't have deps, add deps on this script and on rc.py # 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. # 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: {}/tool_wrapper.py'.format(TOOL_DIR))
print('Note: including file: ../../build/toolchain/win/rc/rc.py') print('Note: including file: {}/rc/rc.py'.format(TOOL_DIR))
print( print(
'Note: including file: ../../build/toolchain/win/rc/linux64/rc.sha1') 'Note: including file: {}/rc/linux64/rc.sha1'.format(TOOL_DIR))
print('Note: including file: ../../build/toolchain/win/rc/mac/rc.sha1') print('Note: including file: {}/rc/mac/rc.sha1'.format(TOOL_DIR))
print( print(
'Note: including file: ../../build/toolchain/win/rc/win/rc.exe.sha1') 'Note: including file: {}/rc/win/rc.exe.sha1'.format(TOOL_DIR))
return p.returncode return p.returncode
......
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