Skip to content

Commit 152bd99

Browse files
committed
build: fix id method for Target vs BuildTarget
Don't put build_target stuff in the Target definition.
1 parent 21bfac0 commit 152bd99

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

mesonbuild/build.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -780,11 +780,8 @@ def construct_id_from_path(subdir: str, name: str, type_suffix: str) -> str:
780780

781781
@lazy_property
782782
def id(self) -> str:
783-
name = self.name
784-
if getattr(self, 'name_suffix_set', False):
785-
name += '.' + self.suffix
786783
return self.construct_id_from_path(
787-
self.builddir, name, self.type_suffix())
784+
self.builddir, self.name, self.type_suffix())
788785

789786
def get_id(self) -> str:
790787
return self.id
@@ -901,6 +898,14 @@ def __init__(
901898
self.validate_install()
902899
self.check_module_linking()
903900

901+
@lazy_property
902+
def id(self) -> str:
903+
name = self.name
904+
if self.name_suffix_set:
905+
name += '.' + self.suffix
906+
return self.construct_id_from_path(
907+
self.builddir, name, self.type_suffix())
908+
904909
def _set_vala_args(self, kwargs: BuildTargetKeywordArguments) -> None:
905910
if self.uses_vala():
906911
self.vala_header = kwargs.get('vala_header') or self.name + '.h'

0 commit comments

Comments
 (0)