mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 02:16:53 +08:00
cmake: fix kconfig cache when setting to 0 or n
This commit is contained in:
committed by
Daniel Agar
parent
408c30de13
commit
5137ca1ccc
+11
-5
@@ -73,12 +73,18 @@ if(EXISTS ${BOARD_DEFCONFIG})
|
|||||||
# Find the value
|
# Find the value
|
||||||
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
||||||
|
|
||||||
if(Value)
|
# remove extra quotes
|
||||||
# remove extra quotes
|
string(REPLACE "\"" "" Value ${Value})
|
||||||
string(REPLACE "\"" "" Value ${Value})
|
|
||||||
|
|
||||||
# Set the variable
|
# Set the variable
|
||||||
set(${Name} ${Value} CACHE INTERNAL "BOARD DEFCONFIG: ${Name}" FORCE)
|
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()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user