aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-11-16 12:31:07 -0800
committerEli Schwartz <eschwartz93@gmail.com>2022-11-17 19:07:15 -0500
commit8526b8c1a9f3549328713b6b36ee8173bef86b68 (patch)
tree23598eba62edcb63a1a310c87a52b3d5286b6ffd
parente45367169f1cffd0a1c5566907227ec305cbe25e (diff)
downloadmeson-8526b8c1a9f3549328713b6b36ee8173bef86b68.zip
meson-8526b8c1a9f3549328713b6b36ee8173bef86b68.tar.gz
meson-8526b8c1a9f3549328713b6b36ee8173bef86b68.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
)