diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-07-30 11:41:48 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-07-30 11:41:48 +0200 |
commit | 988fd0eec5d88bf6534fb1f645777350c20d4723 (patch) | |
tree | b04f8c47dedc7d63b138ce50356f509196c4f7bc /build2/file | |
parent | e3004011bbab5b0e031804465a0c340c7102be6d (diff) |
Actualize project root directories
This solves the problem of changing path spelling on platforms with case-
insensitive filesystems.
For example, you may build a project in the current working directory without
specifying any paths. This means the current working directory will be used as
the project's root. On Windows this could be C:\x.
Now you are building another project that imports the above project and you
specify config.import.x variable pointing to the above build. But you are lazy
to type capital C so you spell it as config.import.x=c:\x.
What happens now is the value from config.import.x is used as the project
root. And now it is a different spelling compared to your original build. This
is not a problem when the build system itself is concerned -- it is smart
enough to use case-insensitive comparison. However, we often use roots to
derive other things, say, -I options that we pass to compilers. And these
options are normally no longer treated as (case-insensitive) paths. If they
are hashed and the result stored in depdb, then we end up with rebuilds that
are triggered by changes from C:\ to c:\.
Diffstat (limited to 'build2/file')
-rw-r--r-- | build2/file | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/build2/file b/build2/file index 00ece85..062487a 100644 --- a/build2/file +++ b/build2/file @@ -34,17 +34,19 @@ namespace build2 bool is_out_root (const dir_path&); - // Given an src_base directory, look for a project's src_root - // based on the presence of known special files. Return empty - // path if not found. + // Given an src_base directory, look for a project's src_root based on the + // presence of known special files. Return empty path if not found. Note + // that if the input is normalized/actualized, then the output will be as + // well. // dir_path find_src_root (const dir_path&); - // The same as above but for project's out. Note that we also - // check whether a directory happens to be src_root, in case - // this is an in-tree build. The second argument is the out - // flag that is set to true if this is src_root. + // The same as above but for project's out. Note that we also check whether + // a directory happens to be src_root, in case this is an in-tree build. The + // second argument is the out flag that is set to true if this is src_root. + // Note that if the input is normalized/actualized, then the output will be + // as well. // dir_path find_out_root (const dir_path&, bool* src = nullptr); |