mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-22 19:41:00 +00:00
cargo_wrapper: Handle windows paths for depfiles
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1021>
This commit is contained in:
parent
cb45ef2c03
commit
0530b324c1
1 changed files with 13 additions and 1 deletions
|
@ -32,7 +32,19 @@ def generate_depfile_for(fpath):
|
|||
with open(f"{file_stem}.d", 'r') as depfile:
|
||||
for l in depfile.readlines():
|
||||
if l.startswith(str(file_stem)):
|
||||
output, srcs = l.split(":", maxsplit=2)
|
||||
# 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)
|
||||
|
||||
all_deps = []
|
||||
for src in srcs.split(" "):
|
||||
|
|
Loading…
Reference in a new issue