diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-29 04:41:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-29 04:41:38 +0000 |
commit | 7b6e527f440cd7e6f8be2b07cee320ee6ca18786 (patch) | |
tree | 4a2738d69fa2814659fdadddf5826282e73d81f4 /test cases/rust/12 bindgen/dependencies/meson.build | |
parent | Initial commit. (diff) | |
download | meson-upstream.tar.xz meson-upstream.zip |
Adding upstream version 1.0.1.upstream/1.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test cases/rust/12 bindgen/dependencies/meson.build')
-rw-r--r-- | test cases/rust/12 bindgen/dependencies/meson.build | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test cases/rust/12 bindgen/dependencies/meson.build b/test cases/rust/12 bindgen/dependencies/meson.build new file mode 100644 index 0000000..37e5a42 --- /dev/null +++ b/test cases/rust/12 bindgen/dependencies/meson.build @@ -0,0 +1,43 @@ +# SPDX-License-Identifier: Apache-2.0 +# Copyright © 2022 Intel Corporation + +dep_zlib = dependency('zlib', required : false, disabler : true) + +external_dep_rs = rust.bindgen( + input : 'external_dep.h', + output : 'external_dep.rs', + dependencies : dep_zlib +) + +external_dep = static_library( + 'external_dep', + [external_dep_rs], + dependencies : dep_zlib.partial_dependency(links : true), +) + +rust.test('external dep', external_dep) + +int_dep = declare_dependency( + sources : [gen_h, gen2_h], + include_directories : include_directories('..'), +) + +internal_dep_rs = rust.bindgen( + input : 'internal_dep.h', + output : 'internal_dep.rs', + dependencies : int_dep, +) + +c_lib2 = static_library( + 'clib2', + 'clib2.c', + dependencies : int_dep, +) + +rust_bin_int_dep = executable( + 'rust_bin_int_dep', + structured_sources(['internal_main.rs', internal_dep_rs]), + link_with : [c_lib, c_lib2], +) + +test('generated header dependency', rust_bin_int_dep) |