mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-02 20:24:32 +02:00
change: use esp_kconfiglib instead of kconfiglib in Python imports
This commit is contained in:
@@ -267,7 +267,20 @@ function(__kconfig_generate_config sdkconfig sdkconfig_defaults)
|
||||
idf_build_set_property(SDKCONFIG_JSON_MENUS ${sdkconfig_json_menus})
|
||||
idf_build_set_property(CONFIG_DIR ${config_dir})
|
||||
|
||||
set(MENUCONFIG_CMD ${python} -m menuconfig)
|
||||
# newer versions of esp-idf-kconfig renamed menuconfig to esp_menuconfig
|
||||
# Order matters here, we want to use esp_menuconfig if it is available
|
||||
execute_process(
|
||||
COMMAND ${python} -c "import esp_menuconfig"
|
||||
RESULT_VARIABLE ESP_MENUCONFIG_AVAILABLE
|
||||
OUTPUT_QUIET ERROR_QUIET
|
||||
)
|
||||
if(ESP_MENUCONFIG_AVAILABLE EQUAL 0)
|
||||
set(MENUCONFIG_CMD ${python} -m esp_menuconfig)
|
||||
else()
|
||||
set(MENUCONFIG_CMD ${python} -m menuconfig)
|
||||
endif()
|
||||
|
||||
|
||||
set(TERM_CHECK_CMD ${python} ${idf_path}/tools/check_term.py)
|
||||
|
||||
if(NOT ${ARG_CREATE_MENUCONFIG_TARGET})
|
||||
|
@@ -1,15 +1,21 @@
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
import kconfiglib
|
||||
# In newer esp-idf-kconfig versions, kconfiglib module is renamed to esp_kconfiglib
|
||||
# Order is important here, as we want to use esp_kconfiglib if available
|
||||
try:
|
||||
import esp_kconfiglib as kconfiglib
|
||||
except ImportError:
|
||||
import kconfiglib
|
||||
|
||||
|
||||
class SDKConfig:
|
||||
"""
|
||||
Evaluates conditional expressions based on the build's sdkconfig and Kconfig files.
|
||||
"""
|
||||
|
||||
def __init__(self, kconfig_file, sdkconfig_file):
|
||||
self.config = kconfiglib.Kconfig(kconfig_file)
|
||||
self.config.load_config(sdkconfig_file)
|
||||
|
Reference in New Issue
Block a user