NuttX cmake support optional compressed defconfigs

This commit is contained in:
Daniel Agar
2019-01-30 10:54:53 -05:00
committed by GitHub
parent 2f4f4c6623
commit 40e42a677b
15 changed files with 249 additions and 145 deletions

View File

@@ -125,25 +125,4 @@ function(px4_os_prebuild_targets)
target_link_libraries(prebuild_targets INTERFACE nuttx_xx nuttx_c nuttx_fs nuttx_mm nuttx_sched m gcc)
add_dependencies(prebuild_targets DEPENDS nuttx_context uorb_headers)
# parse nuttx config options for cmake
file(STRINGS ${PX4_BOARD_DIR}/nuttx-config/${NUTTX_CONFIG}/defconfig ConfigContents)
foreach(NameAndValue ${ConfigContents})
# Strip leading spaces
string(REGEX REPLACE "^[ ]+" "" NameAndValue ${NameAndValue})
# Find variable name
string(REGEX MATCH "^CONFIG[^=]+" Name ${NameAndValue})
if (Name)
# Find the value
string(REPLACE "${Name}=" "" Value ${NameAndValue})
# remove extra quotes
string(REPLACE "\"" "" Value ${Value})
# Set the variable
#message(STATUS "${Name} ${Value}")
set(${Name} ${Value} CACHE INTERNAL "NUTTX DEFCONFIG: ${Name}" FORCE)
endif()
endforeach()
endfunction()