mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
cmake: Write configuration & component metadata to project_description.json
This commit is contained in:
parent
f1d3bfc0c7
commit
56902f0054
@ -52,6 +52,11 @@ function(kconfig_process_config)
|
|||||||
set(defaults_arg --defaults "${SDKCONFIG_DEFAULTS}")
|
set(defaults_arg --defaults "${SDKCONFIG_DEFAULTS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Set these in the parent scope, so that they can be written to project_description.json
|
||||||
|
set(kconfigs "${kconfigs}")
|
||||||
|
set(COMPONENT_KCONFIGS "${kconfigs}" PARENT_SCOPE)
|
||||||
|
set(COMPONENT_KCONFIGS_PROJBUILD "${kconfigs_projbuild}" PARENT_SCOPE)
|
||||||
|
|
||||||
set(confgen_basecommand
|
set(confgen_basecommand
|
||||||
${PYTHON} ${IDF_PATH}/tools/kconfig_new/confgen.py
|
${PYTHON} ${IDF_PATH}/tools/kconfig_new/confgen.py
|
||||||
--kconfig ${ROOT_KCONFIG}
|
--kconfig ${ROOT_KCONFIG}
|
||||||
|
@ -108,8 +108,12 @@ macro(project name)
|
|||||||
idf_add_executable()
|
idf_add_executable()
|
||||||
|
|
||||||
# Write project description JSON file
|
# Write project description JSON file
|
||||||
|
make_json_list("${BUILD_COMPONENTS}" build_components_json)
|
||||||
|
make_json_list("${BUILD_COMPONENT_PATHS}" build_component_paths_json)
|
||||||
configure_file("${IDF_PATH}/tools/cmake/project_description.json.in"
|
configure_file("${IDF_PATH}/tools/cmake/project_description.json.in"
|
||||||
"${CMAKE_BINARY_DIR}/project_description.json")
|
"${CMAKE_BINARY_DIR}/project_description.json")
|
||||||
|
unset(build_components_json)
|
||||||
|
unset(build_component_paths_json)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Finish component registration (add cross-dependencies, make
|
# Finish component registration (add cross-dependencies, make
|
||||||
|
@ -3,9 +3,16 @@
|
|||||||
"project_path": "${PROJECT_PATH}",
|
"project_path": "${PROJECT_PATH}",
|
||||||
"build_dir": "${CMAKE_BINARY_DIR}",
|
"build_dir": "${CMAKE_BINARY_DIR}",
|
||||||
"config_file": "${SDKCONFIG}",
|
"config_file": "${SDKCONFIG}",
|
||||||
|
"config_defaults": "${SDKCONFIG_DEFAULTS}",
|
||||||
"app_elf": "${PROJECT_NAME}.elf",
|
"app_elf": "${PROJECT_NAME}.elf",
|
||||||
"app_bin": "${PROJECT_NAME}.bin",
|
"app_bin": "${PROJECT_NAME}.bin",
|
||||||
"git_revision": "${IDF_VER}",
|
"git_revision": "${IDF_VER}",
|
||||||
"phy_data_partition": "${CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION}",
|
"phy_data_partition": "${CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION}",
|
||||||
"monitor_baud" : "${CONFIG_MONITOR_BAUD}"
|
"monitor_baud" : "${CONFIG_MONITOR_BAUD}",
|
||||||
|
"config_environment" : {
|
||||||
|
"COMPONENT_KCONFIGS" : "${COMPONENT_KCONFIGS}",
|
||||||
|
"COMPONENT_KCONFIGS_PROJBUILD" : "${COMPONENT_KCONFIGS_PROJBUILD}"
|
||||||
|
},
|
||||||
|
"build_components" : ${build_components_json},
|
||||||
|
"build_component_paths" : ${build_component_paths_json}
|
||||||
}
|
}
|
||||||
|
@ -170,3 +170,9 @@ function(target_linker_script target scriptfile)
|
|||||||
# executable(s) the library is linked to. This is done manually in components.cmake.
|
# executable(s) the library is linked to. This is done manually in components.cmake.
|
||||||
set_property(TARGET "${target}" APPEND PROPERTY LINK_DEPENDS "${abs_script}")
|
set_property(TARGET "${target}" APPEND PROPERTY LINK_DEPENDS "${abs_script}")
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
# Convert a CMake list to a JSON list and store it in a variable
|
||||||
|
function(make_json_list list variable)
|
||||||
|
string(REPLACE ";" "\", \"" result "[ \"${list}\" ]")
|
||||||
|
set("${variable}" "${result}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user