Merge pull request #7772 from xclaesse/deprecate-source-root
Deprecate meson.build_root() and meson.source_root()pull/7806/head
commit
5f70984403
8 changed files with 59 additions and 9 deletions
@ -0,0 +1,10 @@ |
||||
## `meson.build_root()` and `meson.source_root()` are deprecated |
||||
|
||||
Those function are common source of issue when used in a subproject because they |
||||
point to the parent project root which is rarely what is expected and is a |
||||
violation of subproject isolation. |
||||
|
||||
`meson.current_source_dir()` and `meson.current_build_dir()` should be used instead |
||||
and have been available in all Meson versions. New functions `meson.project_source_root()` |
||||
and `meson.project_build_root()` have been added in Meson 0.56.0 to get the root |
||||
of the current (sub)project. |
@ -1 +1,3 @@ |
||||
assert(fs.exists('subdirfile.txt'), 'Subdir file lookup is broken.') |
||||
assert(fs.is_samepath(meson.project_source_root(), '..'), 'is_samepath not detecting same directory') |
||||
assert(fs.is_samepath(meson.project_build_root(), meson.current_build_dir() / '..'), 'is_samepath not detecting same directory') |
||||
|
@ -1 +1,3 @@ |
||||
assert(fs.exists('subsubfile.txt'), 'Subproject subdir lookup failed.') |
||||
assert(fs.is_samepath(meson.project_source_root(), meson.current_source_dir() / '..'), 'is_samepath not detecting same directory') |
||||
assert(fs.is_samepath(meson.project_build_root(), meson.current_build_dir() / '..'), 'is_samepath not detecting same directory') |
||||
|
Loading…
Reference in new issue