mirror of
https://github.com/apache/nuttx.git
synced 2025-12-16 01:34:58 +08:00
cmake:fix invalid configs when export defconfig and .config
when func `nuttx_export_kconfig` is called for the second time, the expired configuration will be retained causing compilation failure Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
This commit is contained in:
@@ -35,6 +35,11 @@ function(nuttx_export_kconfig_by_value kconfigfile config)
|
||||
endfunction()
|
||||
|
||||
function(nuttx_export_kconfig kconfigfile)
|
||||
# First delete the expired configuration items
|
||||
get_property(expired_keys GLOBAL PROPERTY NUTTX_CONFIG_KEYS)
|
||||
foreach(key ${expired_keys})
|
||||
set(${key} PARENT_SCOPE)
|
||||
endforeach()
|
||||
file(STRINGS ${kconfigfile} ConfigContents)
|
||||
foreach(NameAndValue ${ConfigContents})
|
||||
# Strip leading spaces
|
||||
@@ -54,6 +59,7 @@ function(nuttx_export_kconfig kconfigfile)
|
||||
set(${Name}
|
||||
${Value}
|
||||
PARENT_SCOPE)
|
||||
set_property(GLOBAL APPEND PROPERTY NUTTX_CONFIG_KEYS ${Name})
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user