configure: don't serialize empty array elements

Before this change:

    $ ./configure --codegen-backends=
    [..]
    $ grep -P '^codegen-backends' config.toml
    codegen-backends = ['']

After this change:

    $ ./configure --codegen-backends=
    [..]
    $ grep -P '^codegen-backends' config.toml
    codegen-backends = []
This commit is contained in:
Jon Gjengset 2022-03-10 12:39:29 -08:00
parent ba14a836c7
commit 7c20a29af8

View File

@ -279,6 +279,10 @@ def build():
def set(key, value):
if isinstance(value, list):
# Remove empty values, which value.split(',') tends to generate.
value = [v for v in value if v]
s = "{:20} := {}".format(key, value)
if len(s) < 70:
p(s)