summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/bml/package.py
diff options
context:
space:
mode:
authorSeth R. Johnson <johnsonsr@ornl.gov>2021-05-19 06:59:06 -0400
committerGitHub <noreply@github.com>2021-05-19 06:59:06 -0400
commit3d2cd480486648cd60c2400b9771df34e7aca684 (patch)
treec4cda21621fba37732020be3a10eb1b0df84c9eb /var/spack/repos/builtin/packages/bml/package.py
parent33df3990de3dc89fcdbefd1cb4b8bfe0b316f43a (diff)
downloadspack-3d2cd480486648cd60c2400b9771df34e7aca684.tar.gz
spack-3d2cd480486648cd60c2400b9771df34e7aca684.tar.bz2
spack-3d2cd480486648cd60c2400b9771df34e7aca684.tar.xz
spack-3d2cd480486648cd60c2400b9771df34e7aca684.zip
Use define_from_variant in numerous CMakePackages (#23655)
Example replacement: ``` '-D(\w+)(:BOOL)?=\{0\}'\.\s*format\s*\(\s*'(ON|YES|true|TRUE)' if '\+(\w+)' in (self\.)?spec else '(OFF|NO|false|FALSE)'\) ``` with ``` self.define_from_variant('\1', '\4') ``` This will cause failures if any variants were misspelled: I have already caught two packages with nonexistent variants.
Diffstat (limited to 'var/spack/repos/builtin/packages/bml/package.py')
-rw-r--r--var/spack/repos/builtin/packages/bml/package.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/bml/package.py b/var/spack/repos/builtin/packages/bml/package.py
index e535e1072d..b3c021315b 100644
--- a/var/spack/repos/builtin/packages/bml/package.py
+++ b/var/spack/repos/builtin/packages/bml/package.py
@@ -34,8 +34,7 @@ class Bml(CMakePackage):
def cmake_args(self):
args = [
- '-DBUILD_SHARED_LIBS={0}'.format(
- 'ON' if '+shared' in self.spec else 'OFF')
+ self.define_from_variant('BUILD_SHARED_LIBS', 'shared')
]
spec = self.spec
if '+mpi' in spec: