Skip to content

Commit

Permalink
cmake: fix kconfig cache when setting to 0 or n
Browse files Browse the repository at this point in the history
  • Loading branch information
PetervdPerk-NXP authored and dagar committed Oct 18, 2023
1 parent 408c30d commit 5137ca1
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions cmake/kconfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)

else()
# Find boolean not set
string(REGEX MATCH " (CONFIG[^ ]+) is not set" Name ${NameAndValue})

# Set the variable
set(${Name} ${Value} CACHE INTERNAL "BOARD DEFCONFIG: ${Name}" FORCE)
if(${CMAKE_MATCH_1})
set(${CMAKE_MATCH_1} "" CACHE INTERNAL "BOARD DEFCONFIG: ${CMAKE_MATCH_1}" FORCE)
endif()
endif()

Expand Down

0 comments on commit 5137ca1

Please sign in to comment.