summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2021-11-19 14:10:00 +0100
committerGitHub <noreply@github.com>2021-11-19 14:10:00 +0100
commitc5aee4d9b4840bc23041fa5d3339012598619cca (patch)
tree385c3ceabf3b3800750abb29a5c6171bc51a91fb /var
parent3db918b1cdfb720df22d6571804259ede8dc40f7 (diff)
downloadspack-c5aee4d9b4840bc23041fa5d3339012598619cca.tar.gz
spack-c5aee4d9b4840bc23041fa5d3339012598619cca.tar.bz2
spack-c5aee4d9b4840bc23041fa5d3339012598619cca.tar.xz
spack-c5aee4d9b4840bc23041fa5d3339012598619cca.zip
define_from_variant: return an empty string for non-existing variants (#27503)
This permits to use conditional variants without a lot of boilerplate.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin.mock/packages/cmake-conditional-variants-test/package.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/cmake-conditional-variants-test/package.py b/var/spack/repos/builtin.mock/packages/cmake-conditional-variants-test/package.py
new file mode 100644
index 0000000000..53ecd1e287
--- /dev/null
+++ b/var/spack/repos/builtin.mock/packages/cmake-conditional-variants-test/package.py
@@ -0,0 +1,9 @@
+# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+class CmakeConditionalVariantsTest(CMakePackage):
+ homepage = "https://dev.null"
+ version('1.0')
+ variant('example', default=True, description='nope', when='@2.0:')