Skip to content

Commit 63b5a02

Browse files
committed
Revert "rust: apply global, project, and environment C args to bindgen"
This reverts commit 36210f6. Fixes mesonbuild#12326
1 parent 0958291 commit 63b5a02

File tree

6 files changed

+1
-57
lines changed

6 files changed

+1
-57
lines changed

mesonbuild/modules/rust.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,6 @@ def bindgen(self, state: ModuleState, args: T.List, kwargs: FuncBindgen) -> Modu
232232
elif isinstance(s, CustomTarget):
233233
depends.append(s)
234234

235-
clang_args.extend(state.global_args.get('c', []))
236-
clang_args.extend(state.project_args.get('c', []))
237-
cargs = state.get_option('args', state.subproject, lang='c')
238-
assert isinstance(cargs, list), 'for mypy'
239-
clang_args.extend(cargs)
240-
241235
if self._bindgen_bin is None:
242236
self._bindgen_bin = state.find_program('bindgen')
243237

test cases/rust/12 bindgen/meson.build

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ if not prog_bindgen.found()
88
error('MESON_SKIP_TEST bindgen not found')
99
endif
1010

11-
add_project_arguments('-DPROJECT_ARG', language : 'c')
12-
add_global_arguments('-DGLOBAL_ARG', language : 'c')
13-
1411
# This seems to happen on windows when libclang.dll is not in path or is not
1512
# valid. We must try to process a header file for this to work.
1613
#
@@ -84,18 +81,3 @@ test('generated header', rust_bin2)
8481

8582
subdir('sub')
8683
subdir('dependencies')
87-
88-
gp = rust.bindgen(
89-
input : 'src/global-project.h',
90-
output : 'global-project.rs',
91-
)
92-
93-
gp_lib = static_library('gp_lib', 'src/global.c')
94-
95-
gp_exe = executable(
96-
'gp_exe',
97-
structured_sources(['src/global.rs', gp]),
98-
link_with : gp_lib,
99-
)
100-
101-
test('global and project arguments', gp_exe)

test cases/rust/12 bindgen/src/global-project.h

Lines changed: 0 additions & 10 deletions
This file was deleted.

test cases/rust/12 bindgen/src/global.c

Lines changed: 0 additions & 5 deletions
This file was deleted.

test cases/rust/12 bindgen/src/global.rs

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
{
2-
"env": {
3-
"CFLAGS": "-DCMD_ARG"
4-
},
52
"stdout": [
63
{
7-
"line": "test cases/rust/12 bindgen/meson.build:30: WARNING: Project targets '>= 0.63' but uses feature introduced in '1.0.0': \"rust.bindgen\" keyword argument \"include_directories\" of type array[str]."
4+
"line": "test cases/rust/12 bindgen/meson.build:27: WARNING: Project targets '>= 0.63' but uses feature introduced in '1.0.0': \"rust.bindgen\" keyword argument \"include_directories\" of type array[str]."
85
}
96
]
107
}

0 commit comments

Comments
 (0)