mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-15 23:01:02 +00:00
cargo_wrapper: Handle windows paths for depfiles
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1027>
This commit is contained in:
parent
161c6db641
commit
041f51c4bb
1 changed files with 13 additions and 1 deletions
|
@ -32,6 +32,18 @@ def generate_depfile_for(fpath):
|
||||||
with open(f"{file_stem}.d", 'r') as depfile:
|
with open(f"{file_stem}.d", 'r') as depfile:
|
||||||
for l in depfile.readlines():
|
for l in depfile.readlines():
|
||||||
if l.startswith(str(file_stem)):
|
if l.startswith(str(file_stem)):
|
||||||
|
# We can't blindly split on `:` because on Windows that's part
|
||||||
|
# of the drive letter. Lucky for us, the format of the dep file
|
||||||
|
# is one of:
|
||||||
|
#
|
||||||
|
# /path/to/output: /path/to/src1 /path/to/src2
|
||||||
|
# /path/to/output:
|
||||||
|
#
|
||||||
|
# So we parse these two cases specifically
|
||||||
|
if l.endswith(':'):
|
||||||
|
output = l[:-1]
|
||||||
|
srcs = ''
|
||||||
|
else:
|
||||||
output, srcs = l.split(": ", maxsplit=2)
|
output, srcs = l.split(": ", maxsplit=2)
|
||||||
|
|
||||||
all_deps = []
|
all_deps = []
|
||||||
|
|
Loading…
Reference in a new issue