cmake: fix kconfig cache when setting to 0 or n

This commit is contained in:
Peter van der Perk 2023-09-05 10:30:53 +02:00 committed by Daniel Agar
parent 408c30de13
commit 5137ca1ccc
1 changed files with 11 additions and 5 deletions

View File

@ -73,12 +73,18 @@ if(EXISTS ${BOARD_DEFCONFIG})
# Find the value
string(REPLACE "${Name}=" "" Value ${NameAndValue})
if(Value)
# remove extra quotes
string(REPLACE "\"" "" Value ${Value})
# remove extra quotes
string(REPLACE "\"" "" Value ${Value})
# Set the variable
set(${Name} ${Value} CACHE INTERNAL "BOARD DEFCONFIG: ${Name}" FORCE)
# Set the variable
set(${Name} ${Value} CACHE INTERNAL "BOARD DEFCONFIG: ${Name}" FORCE)
else()
# Find boolean not set
string(REGEX MATCH " (CONFIG[^ ]+) is not set" Name ${NameAndValue})
if(${CMAKE_MATCH_1})
set(${CMAKE_MATCH_1} "" CACHE INTERNAL "BOARD DEFCONFIG: ${CMAKE_MATCH_1}" FORCE)
endif()
endif()