aboutsummaryrefslogtreecommitdiff
path: root/test cases/common
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2020-07-08 15:22:06 -0400
committerXavier Claessens <xclaesse@gmail.com>2020-07-22 19:19:50 -0400
commitc016401f95bce461a9acefc86bb75884684d9a5f (patch)
treebe9a48db8a29e47d72e5a4e1f5fb08a29516ad42 /test cases/common
parent6bf61b2a384ab42c679097ea749f8c5235f1e9f8 (diff)
downloadmeson-c016401f95bce461a9acefc86bb75884684d9a5f.zip
meson-c016401f95bce461a9acefc86bb75884684d9a5f.tar.gz
meson-c016401f95bce461a9acefc86bb75884684d9a5f.tar.bz2
coredata: Make warning_level per subproject builtin option
Diffstat (limited to 'test cases/common')
-rw-r--r--test cases/common/230 persubproject options/meson.build4
-rw-r--r--test cases/common/230 persubproject options/subprojects/sub1/foo.c3
-rw-r--r--test cases/common/230 persubproject options/subprojects/sub1/meson.build4
3 files changed, 9 insertions, 2 deletions
diff --git a/test cases/common/230 persubproject options/meson.build b/test cases/common/230 persubproject options/meson.build
index 20dff90..f76a70c 100644
--- a/test cases/common/230 persubproject options/meson.build
+++ b/test cases/common/230 persubproject options/meson.build
@@ -1,9 +1,11 @@
project('persubproject options', 'c',
default_options : ['default_library=both',
- 'werror=true'])
+ 'werror=true',
+ 'warning_level=3'])
assert(get_option('default_library') == 'both', 'Parent default_library should be "both"')
assert(get_option('werror'))
+assert(get_option('warning_level') == '3')
# Check it build both by calling a method only both_libraries target implement
lib = library('lib1', 'foo.c')
diff --git a/test cases/common/230 persubproject options/subprojects/sub1/foo.c b/test cases/common/230 persubproject options/subprojects/sub1/foo.c
index 63e4de6..82ad2c2 100644
--- a/test cases/common/230 persubproject options/subprojects/sub1/foo.c
+++ b/test cases/common/230 persubproject options/subprojects/sub1/foo.c
@@ -1,5 +1,8 @@
int foo(void);
int foo(void) {
+ /* This is built with -Werror, it would error if warning_level=3 was inherited
+ * from main project and not overridden by this subproject's default_options. */
+ int x;
return 0;
}
diff --git a/test cases/common/230 persubproject options/subprojects/sub1/meson.build b/test cases/common/230 persubproject options/subprojects/sub1/meson.build
index 7afc934..4e4bc1b 100644
--- a/test cases/common/230 persubproject options/subprojects/sub1/meson.build
+++ b/test cases/common/230 persubproject options/subprojects/sub1/meson.build
@@ -1,6 +1,8 @@
-project('sub1', 'c')
+project('sub1', 'c',
+ default_options : ['warning_level=0'])
assert(get_option('default_library') == 'both', 'Should inherit parent project default_library')
+assert(get_option('warning_level') == '0')
# Check it build both by calling a method only both_libraries target implement
lib = library('lib1', 'foo.c')