Skip to content

Commit

Permalink
modules/rust: Also include generated sources for tests
Browse files Browse the repository at this point in the history
When we create a test from a non-executable, we weren't copying the
generated sources, just the static ones.
  • Loading branch information
dcbaker authored and eli-schwartz committed Nov 18, 2022
1 parent e453671 commit 8526b8c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mesonbuild/modules/rust.py
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -147,9 +147,12 @@ def test(self, state: 'ModuleState', args: T.Tuple[str, BuildTarget], kwargs: 'F
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
)
Expand Down

0 comments on commit 8526b8c

Please sign in to comment.