mirror of
https://github.com/mesonbuild/meson.git
synced 2026-06-24 08:48:03 +00:00
backends/ninja: refactor RustrCrate to remove is_proc_macro
It's always derived from the value of proc_macro_dylib_path anyway, so move that into the function itself. This also resolves some strict null issues.
This commit is contained in:
committed by
Paolo Bonzini
parent
9151be0088
commit
f302ad477d
@@ -470,7 +470,6 @@ class RustCrate:
|
||||
edition: RUST_EDITIONS
|
||||
deps: T.List[RustDep]
|
||||
cfg: T.List[str]
|
||||
is_proc_macro: bool
|
||||
|
||||
# This is set to True for members of this project, and False for all
|
||||
# subprojects
|
||||
@@ -483,13 +482,12 @@ class RustCrate:
|
||||
"root_module": self.root_module,
|
||||
"edition": self.edition,
|
||||
"cfg": self.cfg,
|
||||
"is_proc_macro": self.is_proc_macro,
|
||||
"is_proc_macro": self.proc_macro_dylib_path is not None,
|
||||
"deps": [d.to_json() for d in self.deps],
|
||||
}
|
||||
|
||||
if self.is_proc_macro:
|
||||
assert self.proc_macro_dylib_path is not None, "This shouldn't happen"
|
||||
ret["proc_macro_dylib_path"] = self.proc_macro_dylib_path
|
||||
if (proc_macro := self.proc_macro_dylib_path) is not None:
|
||||
ret["proc_macro_dylib_path"] = proc_macro
|
||||
|
||||
return ret
|
||||
|
||||
@@ -1982,7 +1980,6 @@ class NinjaBackend(backends.Backend):
|
||||
deps,
|
||||
cfg,
|
||||
is_workspace_member=not from_subproject,
|
||||
is_proc_macro=proc_macro_dylib_path is not None,
|
||||
proc_macro_dylib_path=proc_macro_dylib_path,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user