meson: create unique names for build directory (#32062)

Taken from CMakePackage
This commit is contained in:
Simon Pintarelli 2022-08-23 13:24:32 +02:00 committed by GitHub
parent 0f25d3b219
commit 44258a7cce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,13 +138,21 @@ def flags_to_build_system_args(self, flags):
# Has to be dynamic attribute due to caching
setattr(self, "meson_flag_args", [])
@property
def build_dirname(self):
"""Returns the directory name to use when building the package
:return: name of the subdirectory for building the package
"""
return "spack-build-%s" % self.spec.dag_hash(7)
@property
def build_directory(self):
"""Returns the directory to use when building the package
:return: directory where to build the package
"""
return os.path.join(self.stage.source_path, "spack-build")
return os.path.join(self.stage.path, self.build_dirname)
def meson_args(self):
"""Produces a list containing all the arguments that must be passed to