From c016401f95bce461a9acefc86bb75884684d9a5f Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Wed, 8 Jul 2020 15:22:06 -0400 Subject: coredata: Make warning_level per subproject builtin option --- test cases/common/230 persubproject options/meson.build | 4 +++- test cases/common/230 persubproject options/subprojects/sub1/foo.c | 3 +++ .../common/230 persubproject options/subprojects/sub1/meson.build | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) (limited to 'test cases/common') 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') -- cgit v1.1