This may be of particular use when a header is .h but should be treated as a C++ header instead of a C header.pull/12263/head
parent
8ac4346943
commit
05d49c6990
4 changed files with 42 additions and 6 deletions
@ -0,0 +1,5 @@ |
||||
## Overriding bindgen language setting |
||||
|
||||
Even though Meson will now tell bindgen to do the right thing in most cases, |
||||
there may still be cases where Meson does not have the intended behavior, |
||||
specifically with headers with a `.h` suffix, but are C++ headers. |
@ -0,0 +1,19 @@ |
||||
# SPDX-license-identifer: Apache-2.0 |
||||
# Copyright © 2021-2023 Intel Corporation |
||||
|
||||
fs = import('fs') |
||||
|
||||
cpp_header = fs.copyfile('../src/header.hpp', 'cpp_header.h') |
||||
|
||||
cpp_bind_override = rust.bindgen( |
||||
input : cpp_header, |
||||
output : 'generated-cpp.rs', |
||||
language : 'cpp', |
||||
) |
||||
|
||||
cpp_exe2 = executable( |
||||
'cpp_exe2', |
||||
structured_sources(['../src/cpp.rs', cpp_bind_override]), |
||||
link_with : cpp_lib, |
||||
) |
||||
test('cpp-forced', cpp_exe2) |
Loading…
Reference in new issue