]> git.ipfire.org Git - thirdparty/ccache.git/commit
Handle several levels of nonexistent directories in make_relative_path (#334)
authorjonnyyu <yingshen.yu@gmail.com>
Sun, 9 Dec 2018 18:15:58 +0000 (02:15 +0800)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 9 Dec 2018 18:15:58 +0000 (19:15 +0100)
commita68ccd960a685d6082ecc6963d2de311b02632d9
tree1952c4a8d27e1ac937c1eb847cf984638fef1ca9
parent1dfa6e8533cabe4ea729be604b1834148b5f69c6
Handle several levels of nonexistent directories in make_relative_path (#334)

Currently, ccache supports calculating relative path
for 1 level non-exist path. That is to say,
if the given path does not exist, however if its
parent directory exists, then ccache can calculate
the relative path correctly.

Unfortunately this doesn't fit the needs.
Xcode build system always adds these paths into header search path:
xxxxx/DerivedResources/x86-64
xxxxx/DerivedResources

these paths are build outputs for build rules.
For projects which doesn't use build rule to generate files
these directories do not exist.

So this change refine the logic of make_relative_path
to recursively go up find the nearest existing directory
and use the remaining path as path_suffix.
src/ccache.c