diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2022-03-18 19:46:47 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2022-03-21 11:26:52 -0700 |
commit | 9b83fc5ece8932661ea0255e5362417fef117b15 (patch) | |
tree | 411b767330b560b74cd54b295b758d10d6db7eb0 /test cases/rust/18 structured sources | |
parent | f9445300b3015308fd6a3e0305cf8e5b7f002211 (diff) | |
download | meson-9b83fc5ece8932661ea0255e5362417fef117b15.zip meson-9b83fc5ece8932661ea0255e5362417fef117b15.tar.gz meson-9b83fc5ece8932661ea0255e5362417fef117b15.tar.bz2 |
ninja: fix handling of rust structured_sources in rare case
In the even that all of the inputs are generated, and they're all
generated into the same folder, and there are no subfolders, we would
fail to correctly handle all of the files after the main file. Let's fix
that.t
Diffstat (limited to 'test cases/rust/18 structured sources')
4 files changed, 31 insertions, 0 deletions
diff --git a/test cases/rust/18 structured sources/main-gen-copy.rs b/test cases/rust/18 structured sources/main-gen-copy.rs new file mode 100644 index 0000000..db66a51 --- /dev/null +++ b/test cases/rust/18 structured sources/main-gen-copy.rs @@ -0,0 +1,5 @@ +include!(r#"@dir@/include.rs"#); + +pub fn main() { + priv_func(); +} diff --git a/test cases/rust/18 structured sources/meson.build b/test cases/rust/18 structured sources/meson.build index 8fa0443..d84e83f 100644 --- a/test cases/rust/18 structured sources/meson.build +++ b/test cases/rust/18 structured sources/meson.build @@ -37,3 +37,22 @@ executable( ) test('no-copy', find_program('no_copy_test.py'), args : meson.current_build_dir()) + +subdir('src2') + +executable('copy-no-gen', srcs2) + +m_src = configure_file( + input : 'main-gen-copy.rs', + output : 'main-gen-copy.rs', + configuration : {'dir' : meson.current_build_dir().replace('\\', '/')}, +) + +m_src2 = configure_file( + input : 'priv.rs', + output : 'include.rs', + copy : true +) + +executable('gen-no-copy', structured_sources([m_src, m_src2])) + diff --git a/test cases/rust/18 structured sources/priv.rs b/test cases/rust/18 structured sources/priv.rs new file mode 100644 index 0000000..aad196b --- /dev/null +++ b/test cases/rust/18 structured sources/priv.rs @@ -0,0 +1,3 @@ +fn priv_func() { + std::process::exit(0); +} diff --git a/test cases/rust/18 structured sources/src2/meson.build b/test cases/rust/18 structured sources/src2/meson.build new file mode 100644 index 0000000..b4844d2 --- /dev/null +++ b/test cases/rust/18 structured sources/src2/meson.build @@ -0,0 +1,4 @@ +srcs2 = structured_sources( + ['main-unique.rs'], + {'foo': 'foo/mod.rs'}, +) |