diff options
author | Nicolas Schneider <nioncode+git@gmail.com> | 2019-01-01 13:05:26 +0100 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-01-01 19:36:37 +0200 |
commit | 31e1a310309f6a3c46ff837414f70ee120397565 (patch) | |
tree | ef09bd4818db71a45e723d21dc62160bc35e279c | |
parent | 8c9fcb1feac8ef7e4064ede9035f76ad53dc8e09 (diff) | |
download | meson-31e1a310309f6a3c46ff837414f70ee120397565.zip meson-31e1a310309f6a3c46ff837414f70ee120397565.tar.gz meson-31e1a310309f6a3c46ff837414f70ee120397565.tar.bz2 |
fail configuration if PCH files do not exist
Previously, the configuration worked fine, but the compiler raised an
error. Now, we explicitly check for the existence of files and print a
useful error message if they do not exist.
-rw-r--r-- | mesonbuild/build.py | 3 | ||||
-rw-r--r-- | test cases/failing/92 missing pch file/meson.build | 3 | ||||
-rw-r--r-- | test cases/failing/92 missing pch file/prog.c | 3 |
3 files changed, 9 insertions, 0 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 1fcbc04..5d0fefa 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -1082,6 +1082,9 @@ You probably should put it in link_with instead.''') raise InvalidArguments('PCH argument %s is of unknown type.' % pchlist[0]) elif len(pchlist) > 2: raise InvalidArguments('PCH definition may have a maximum of 2 files.') + for f in pchlist: + if not os.path.isfile(os.path.join(self.environment.source_dir, self.subdir, f)): + raise MesonException('File %s does not exist.' % f) self.pch[language] = pchlist def add_include_dirs(self, args): diff --git a/test cases/failing/92 missing pch file/meson.build b/test cases/failing/92 missing pch file/meson.build new file mode 100644 index 0000000..a67b798 --- /dev/null +++ b/test cases/failing/92 missing pch file/meson.build @@ -0,0 +1,3 @@ +project('pch test', 'c') +exe = executable('prog', 'prog.c', +c_pch : ['pch/prog_pch.c', 'pch/prog.h']) diff --git a/test cases/failing/92 missing pch file/prog.c b/test cases/failing/92 missing pch file/prog.c new file mode 100644 index 0000000..11b7fad --- /dev/null +++ b/test cases/failing/92 missing pch file/prog.c @@ -0,0 +1,3 @@ +int main(int argc, char **argv) { + return 0; +} |