mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 17:19:09 -04:00
Merge branch 'backport/fix/empty_int_handling' into 'release/v5.0'
fix(kconfgen): Improve error message for int/hex without default See merge request espressif/esp-idf!37215
This commit is contained in:
commit
a5099fa00b
@ -7,12 +7,10 @@
|
|||||||
# Used internally by the ESP-IDF build system. But designed to be
|
# Used internally by the ESP-IDF build system. But designed to be
|
||||||
# non-IDF-specific.
|
# non-IDF-specific.
|
||||||
#
|
#
|
||||||
# SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD
|
# SPDX-FileCopyrightText: 2018-2025 Espressif Systems (Shanghai) CO LTD
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import json
|
import json
|
||||||
import os
|
|
||||||
import os.path
|
import os.path
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
@ -388,9 +386,17 @@ def write_cmake(deprecated_options, config, filename):
|
|||||||
sym = node.item
|
sym = node.item
|
||||||
if not isinstance(sym, kconfiglib.Symbol):
|
if not isinstance(sym, kconfiglib.Symbol):
|
||||||
return
|
return
|
||||||
|
|
||||||
if sym.config_string:
|
if sym.config_string:
|
||||||
val = sym.str_value
|
val = sym.str_value
|
||||||
|
if not val and sym.type in (
|
||||||
|
kconfiglib.INT,
|
||||||
|
kconfiglib.HEX,
|
||||||
|
):
|
||||||
|
print(
|
||||||
|
f'warning: {sym.name} has no value set in the configuration.'
|
||||||
|
' This can be caused e.g. by missing default value for the current chip version.'
|
||||||
|
)
|
||||||
|
val = None
|
||||||
if sym.orig_type in (kconfiglib.BOOL, kconfiglib.TRISTATE) and val == 'n':
|
if sym.orig_type in (kconfiglib.BOOL, kconfiglib.TRISTATE) and val == 'n':
|
||||||
val = '' # write unset values as empty variables
|
val = '' # write unset values as empty variables
|
||||||
elif sym.orig_type == kconfiglib.STRING:
|
elif sym.orig_type == kconfiglib.STRING:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user