define_from_variant: return an empty string for non-existing variants (#27503)

This permits to use conditional variants without a lot of boilerplate.
This commit is contained in:
Harmen Stoppels
2021-11-19 14:10:00 +01:00
committed by GitHub
parent 3db918b1cd
commit c5aee4d9b4
4 changed files with 38 additions and 0 deletions

View File

@@ -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:')