diff options
| author | Xavier Claessens <xavier.claessens@collabora.com> | 2022-03-21 16:42:55 -0400 |
|---|---|---|
| committer | Xavier Claessens <xclaesse@gmail.com> | 2022-03-24 12:27:06 -0400 |
| commit | f2d21bf8a98fe4eb528a077f3faf5d68cd35c244 (patch) | |
| tree | 4f750b938ad79de8c0e32f8301d1d9d36eac9fe6 /test cases/failing | |
| parent | ebbe4425e7a1c1c16281ef163e443fc1c0a8b209 (diff) | |
| download | meson-f2d21bf8a98fe4eb528a077f3faf5d68cd35c244.tar.gz | |
Make compilers list per subproject
Previously subprojects inherited languages already added by main
project, or any previous subproject. This change to have a list of
compilers per interpreters, which means that if a subproject does not
add 'c' language it won't be able to compile .c files any more, even if
main project added the 'c' language.
This delays processing list of compilers until the interpreter adds the
BuildTarget into its list of targets. That way the interpreter can add
missing languages instead of duplicating that logic into BuildTarget for
the cython case.
Diffstat (limited to 'test cases/failing')
7 files changed, 18 insertions, 3 deletions
diff --git a/test cases/failing/100 no lang/test.json b/test cases/failing/100 no lang/test.json index 58dc1ac2e..a74adaf60 100644 --- a/test cases/failing/100 no lang/test.json +++ b/test cases/failing/100 no lang/test.json @@ -1,7 +1,7 @@ { "stdout": [ { - "line": "test cases/failing/100 no lang/meson.build:2:0: ERROR: No host machine compiler for \"main.c\"" + "line": "test cases/failing/100 no lang/meson.build:2:0: ERROR: No host machine compiler for 'main.c'" } ] } diff --git a/test cases/failing/123 missing compiler/meson.build b/test cases/failing/123 missing compiler/meson.build new file mode 100644 index 000000000..19bdd0c66 --- /dev/null +++ b/test cases/failing/123 missing compiler/meson.build @@ -0,0 +1,3 @@ +project('main project', 'c') + +subproject('sub') diff --git a/test cases/failing/123 missing compiler/subprojects/sub/main.c b/test cases/failing/123 missing compiler/subprojects/sub/main.c new file mode 100644 index 000000000..44e82e227 --- /dev/null +++ b/test cases/failing/123 missing compiler/subprojects/sub/main.c @@ -0,0 +1 @@ +int main(int argc, char *argv[]) { return 0; } diff --git a/test cases/failing/123 missing compiler/subprojects/sub/meson.build b/test cases/failing/123 missing compiler/subprojects/sub/meson.build new file mode 100644 index 000000000..b60850c9c --- /dev/null +++ b/test cases/failing/123 missing compiler/subprojects/sub/meson.build @@ -0,0 +1,4 @@ +project('sub') + +# Should fail because we did not add C language, even if parent project did. +executable('app', 'main.c') diff --git a/test cases/failing/123 missing compiler/test.json b/test cases/failing/123 missing compiler/test.json new file mode 100644 index 000000000..915df164c --- /dev/null +++ b/test cases/failing/123 missing compiler/test.json @@ -0,0 +1,7 @@ +{ + "stdout": [ + { + "line": "test cases/failing/123 missing compiler/subprojects/sub/meson.build:4:0: ERROR: No host machine compiler for 'subprojects/sub/main.c'" + } + ] +} diff --git a/test cases/failing/54 wrong shared crate type/meson.build b/test cases/failing/54 wrong shared crate type/meson.build index b9fcad4e5..90020faf8 100644 --- a/test cases/failing/54 wrong shared crate type/meson.build +++ b/test cases/failing/54 wrong shared crate type/meson.build @@ -4,4 +4,4 @@ if not add_languages('rust', required: false) error('MESON_SKIP_TEST test requires rust compiler') endif -shared_library('test', 'foo.rs', rust_crate_type : 'staticlib') +shared_library('mytest', 'foo.rs', rust_crate_type : 'staticlib') diff --git a/test cases/failing/55 wrong static crate type/meson.build b/test cases/failing/55 wrong static crate type/meson.build index 109907f96..179d7cd53 100644 --- a/test cases/failing/55 wrong static crate type/meson.build +++ b/test cases/failing/55 wrong static crate type/meson.build @@ -4,4 +4,4 @@ if not add_languages('rust', required: false) error('MESON_SKIP_TEST test requires rust compiler') endif -static_library('test', 'foo.rs', rust_crate_type : 'cdylib') +static_library('mytest', 'foo.rs', rust_crate_type : 'cdylib') |
