diff options
author | Daniel Mensinger <daniel@mensinger-ka.de> | 2020-02-17 21:12:18 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-02-19 23:07:41 +0200 |
commit | 55d3fe4f4a5ca0bdfed79ba8a7cee2ca538f6370 (patch) | |
tree | 27f15c7f8a54e9d8a60e6b420c47daa977509b0f /mesonbuild/cmake/interpreter.py | |
parent | 76ae8658645c3e697bdf95777bbd36df7c1dd622 (diff) | |
download | meson-55d3fe4f4a5ca0bdfed79ba8a7cee2ca538f6370.zip meson-55d3fe4f4a5ca0bdfed79ba8a7cee2ca538f6370.tar.gz meson-55d3fe4f4a5ca0bdfed79ba8a7cee2ca538f6370.tar.bz2 |
cmake: Ignore files that violate subproject isolation (fixes #6640)
Diffstat (limited to 'mesonbuild/cmake/interpreter.py')
-rw-r--r-- | mesonbuild/cmake/interpreter.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/mesonbuild/cmake/interpreter.py b/mesonbuild/cmake/interpreter.py index 81844a0..4d87705 100644 --- a/mesonbuild/cmake/interpreter.py +++ b/mesonbuild/cmake/interpreter.py @@ -399,7 +399,19 @@ class ConverterTarget: if not os.path.isabs(x): x = os.path.normpath(os.path.join(self.src_dir, x)) if not os.path.exists(x) and not any([x.endswith(y) for y in obj_suffixes]) and not is_generated: - mlog.warning('CMake: path', mlog.bold(x), 'does not exist. Ignoring. This can lead to build errors') + mlog.warning('CMake: path', mlog.bold(x), 'does not exist.') + mlog.warning(' --> Ignoring. This can lead to build errors.') + return None + if ( + os.path.isabs(x) + and os.path.commonpath([x, self.env.get_source_dir()]) == self.env.get_source_dir() + and not ( + os.path.commonpath([x, root_src_dir]) == root_src_dir or + os.path.commonpath([x, self.env.get_build_dir()]) == self.env.get_build_dir() + ) + ): + mlog.warning('CMake: path', mlog.bold(x), 'is inside the root project but', mlog.bold('not'), 'inside the subproject.') + mlog.warning(' --> Ignoring. This can lead to build errors.') return None if os.path.isabs(x) and os.path.commonpath([x, self.env.get_build_dir()]) == self.env.get_build_dir(): if is_header: |