summaryrefslogtreecommitdiff
path: root/test cases
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2016-12-11 21:51:38 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-12-13 14:19:34 +0200
commitb01d2c35b7003071fc64c6d2e7d07b7652a8b386 (patch)
tree674816b79fd79d9b57384481c98408700db38d48 /test cases
parentde83e94b5a9ce0f540814cee40ef3746b6ebb824 (diff)
downloadmeson-b01d2c35b7003071fc64c6d2e7d07b7652a8b386.tar.gz
Only add build dir inlude directives if the corresponding dir exists. Closes #1185.
Diffstat (limited to 'test cases')
-rw-r--r--test cases/common/130 no buildincdir/include/header.h3
-rw-r--r--test cases/common/130 no buildincdir/meson.build14
-rw-r--r--test cases/common/130 no buildincdir/prog.c5
3 files changed, 22 insertions, 0 deletions
diff --git a/test cases/common/130 no buildincdir/include/header.h b/test cases/common/130 no buildincdir/include/header.h
new file mode 100644
index 000000000..add185031
--- /dev/null
+++ b/test cases/common/130 no buildincdir/include/header.h
@@ -0,0 +1,3 @@
+#pragma once
+
+int foobar();
diff --git a/test cases/common/130 no buildincdir/meson.build b/test cases/common/130 no buildincdir/meson.build
new file mode 100644
index 000000000..ac69e8e46
--- /dev/null
+++ b/test cases/common/130 no buildincdir/meson.build
@@ -0,0 +1,14 @@
+project('nobuilddir', 'c',
+ default_options : 'werror=true')
+
+cc = meson.get_compiler('c')
+
+incwarg = '-Wmissing-include-dirs'
+
+if cc.has_argument(incwarg)
+ executable('prog', 'prog.c',
+ c_args : incwarg,
+ include_directories : include_directories('include'))
+else
+ error('MESON_SKIP_TEST compiler does not support bad inc dir argument.')
+endif
diff --git a/test cases/common/130 no buildincdir/prog.c b/test cases/common/130 no buildincdir/prog.c
new file mode 100644
index 000000000..800f0d6d1
--- /dev/null
+++ b/test cases/common/130 no buildincdir/prog.c
@@ -0,0 +1,5 @@
+#include"header.h"
+
+int main(int argc, char **argv) {
+ return 0;
+}