aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-11-16 12:31:07 -0800
committerNirbheek Chauhan <nirbheek@centricular.com>2022-11-21 15:43:52 +0530
commit48d7c99107ef5886b84a3de75db2af53876694f8 (patch)
tree68e47f1729aa4d286d24a33789e1c26bf0a72da7
parent0d3f0ff8d2241b3d7c1066b6fce734b85a00916d (diff)
downloadmeson-48d7c99107ef5886b84a3de75db2af53876694f8.zip
meson-48d7c99107ef5886b84a3de75db2af53876694f8.tar.gz
meson-48d7c99107ef5886b84a3de75db2af53876694f8.tar.bz2
modules/rust: Also include generated sources for tests
When we create a test from a non-executable, we weren't copying the generated sources, just the static ones.
-rw-r--r--mesonbuild/modules/rust.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/mesonbuild/modules/rust.py b/mesonbuild/modules/rust.py
index 9d7627e..3133327 100644
--- a/mesonbuild/modules/rust.py
+++ b/mesonbuild/modules/rust.py
@@ -1,4 +1,4 @@
-# Copyright © 2020 Intel Corporation
+# Copyright © 2020-2022 Intel Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -147,9 +147,12 @@ class RustModule(ExtensionModule):
new_target_kwargs['install'] = False
new_target_kwargs['dependencies'] = new_target_kwargs.get('dependencies', []) + kwargs['dependencies']
+ sources = T.cast('T.List[SourceOutputs]', base_target.sources.copy())
+ sources.extend(base_target.generated)
+
new_target = Executable(
name, base_target.subdir, state.subproject, base_target.for_machine,
- base_target.sources, base_target.structured_sources,
+ sources, base_target.structured_sources,
base_target.objects, base_target.environment, base_target.compilers,
new_target_kwargs
)