mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 02:16:53 +08:00
platforms/nuttx: init.cmake skip config lines with empty values
This commit is contained in:
@@ -153,15 +153,17 @@ foreach(NameAndValue ${ConfigContents})
|
|||||||
# Find variable name
|
# Find variable name
|
||||||
string(REGEX MATCH "^CONFIG[^=]+" Name ${NameAndValue})
|
string(REGEX MATCH "^CONFIG[^=]+" Name ${NameAndValue})
|
||||||
|
|
||||||
if (Name)
|
if(Name)
|
||||||
# Find the value
|
# Find the value
|
||||||
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
string(REPLACE "${Name}=" "" Value ${NameAndValue})
|
||||||
|
|
||||||
# remove extra quotes
|
if(Value)
|
||||||
string(REPLACE "\"" "" Value ${Value})
|
# remove extra quotes
|
||||||
|
string(REPLACE "\"" "" Value ${Value})
|
||||||
|
|
||||||
# Set the variable
|
# Set the variable
|
||||||
#message(STATUS "${Name} ${Value}")
|
#message(STATUS "${Name} ${Value}")
|
||||||
set(${Name} ${Value} CACHE INTERNAL "NUTTX DEFCONFIG: ${Name}" FORCE)
|
set(${Name} ${Value} CACHE INTERNAL "NUTTX DEFCONFIG: ${Name}" FORCE)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|||||||
Reference in New Issue
Block a user