Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/modules/FindHostTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,4 +116,4 @@ set(HostTools_FOUND TRUE)
set(HOSTTOOLS_FOUND TRUE)
build_info(toolchain name VALUE ${ZEPHYR_TOOLCHAIN_VARIANT})
string(TOUPPER ${ZEPHYR_TOOLCHAIN_VARIANT} zephyr_toolchain_variant_upper)
build_info(toolchain path VALUE "${${zephyr_toolchain_variant_upper}_TOOLCHAIN_PATH}")
build_info(toolchain path PATH "${${zephyr_toolchain_variant_upper}_TOOLCHAIN_PATH}")
10 changes: 5 additions & 5 deletions cmake/modules/dts.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ set(dts_files
if(DTC_OVERLAY_FILE)
zephyr_list(TRANSFORM DTC_OVERLAY_FILE NORMALIZE_PATHS
OUTPUT_VARIABLE DTC_OVERLAY_FILE_AS_LIST)
build_info(devicetree user-files VALUE ${DTC_OVERLAY_FILE_AS_LIST})
build_info(devicetree user-files PATH ${DTC_OVERLAY_FILE_AS_LIST})
list(APPEND
dts_files
${DTC_OVERLAY_FILE_AS_LIST}
Expand All @@ -192,7 +192,7 @@ endif()
if(EXTRA_DTC_OVERLAY_FILE)
zephyr_list(TRANSFORM EXTRA_DTC_OVERLAY_FILE NORMALIZE_PATHS
OUTPUT_VARIABLE EXTRA_DTC_OVERLAY_FILE_AS_LIST)
build_info(devicetree extra-user-files VALUE ${EXTRA_DTC_OVERLAY_FILE_AS_LIST})
build_info(devicetree extra-user-files PATH ${EXTRA_DTC_OVERLAY_FILE_AS_LIST})
list(APPEND
dts_files
${EXTRA_DTC_OVERLAY_FILE_AS_LIST}
Expand Down Expand Up @@ -390,6 +390,6 @@ elseif(stderr)
endif()
endif(DTC)

build_info(devicetree files VALUE ${dts_files})
build_info(devicetree include-dirs VALUE ${DTS_ROOT_SYSTEM_INCLUDE_DIRS})
build_info(devicetree bindings-dirs VALUE ${DTS_ROOT_BINDINGS})
build_info(devicetree files PATH ${dts_files})
build_info(devicetree include-dirs PATH ${DTS_ROOT_SYSTEM_INCLUDE_DIRS})
build_info(devicetree bindings-dirs PATH ${DTS_ROOT_BINDINGS})
23 changes: 21 additions & 2 deletions cmake/modules/extensions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3596,7 +3596,8 @@ function(topological_sort)
endfunction()

# Usage:
# build_info(<tag>... VALUE <value>...)
# build_info(<tag>... VALUE <value>... )
# build_info(<tag>... PATH <path>... )
#
# This function populates updates the build_info.yml info file with exchangable build information
# related to the current build.
Expand All @@ -3613,11 +3614,20 @@ endfunction()
# <tag>...: One of the pre-defined valid CMake keys supported by build info or vendor-specific.
# See 'scripts/schemas/build-schema.yml' CMake section for valid tags.
# VALUE <value>... : value(s) to place in the build_info.yml file.
# PATH <path>... : path(s) to place in the build_info.yml file. All paths are converted to CMake
# style. If no conversion is required, for example when paths are already
# guaranteed to be CMake style, then VALUE can also be used.
function(build_info)
set(convert_path FALSE)
set(arg_list ${ARGV})
list(FIND arg_list VALUE index)
if(index EQUAL -1)
message(FATAL_ERROR "${CMAKE_CURRENT_FUNCTION}(...) missing a required argument: VALUE")
list(FIND arg_list PATH index)
set(convert_path TRUE)
endif()

if(index EQUAL -1)
message(FATAL_ERROR "${CMAKE_CURRENT_FUNCTION}(...) missing a required argument: VALUE or PATH")
endif()

yaml_context(EXISTS NAME build_info result)
Expand All @@ -3635,6 +3645,15 @@ function(build_info)
list(SUBLIST arg_list ${index} -1 values)
list(POP_FRONT values)

if(convert_path)
set(converted_values)
foreach(val ${values})
cmake_path(SET cmake_path "${val}")
list(APPEND converted_values "${cmake_path}")
endforeach()
set(values "${converted_values}")
endif()

if(ARGV0 STREQUAL "vendor-specific")
set(type VALUE)
else()
Expand Down
6 changes: 3 additions & 3 deletions cmake/modules/kconfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ set(PARSED_KCONFIG_SOURCES_TXT ${PROJECT_BINARY_DIR}/kconfig/sources.txt)
if(CONF_FILE)
string(CONFIGURE "${CONF_FILE}" CONF_FILE_EXPANDED)
string(REPLACE " " ";" CONF_FILE_AS_LIST "${CONF_FILE_EXPANDED}")
build_info(kconfig user-files VALUE ${CONF_FILE_AS_LIST})
build_info(kconfig user-files PATH ${CONF_FILE_AS_LIST})
endif()

if(EXTRA_CONF_FILE)
string(CONFIGURE "${EXTRA_CONF_FILE}" EXTRA_CONF_FILE_EXPANDED)
string(REPLACE " " ";" EXTRA_CONF_FILE_AS_LIST "${EXTRA_CONF_FILE_EXPANDED}")
build_info(kconfig extra-user-files VALUE ${EXTRA_CONF_FILE_AS_LIST})
build_info(kconfig extra-user-files PATH ${EXTRA_CONF_FILE_AS_LIST})
endif()

zephyr_file(CONF_FILES ${BOARD_EXTENSION_DIRS} KCONF board_extension_conf_files SUFFIX ${FILE_SUFFIX})
Expand Down Expand Up @@ -360,7 +360,7 @@ endif()
if(CREATE_NEW_DOTCONFIG)
set(input_configs_flags --handwritten-input-configs)
set(input_configs ${merge_config_files} ${FORCED_CONF_FILE})
build_info(kconfig files VALUE ${input_configs})
build_info(kconfig files PATH ${input_configs})
else()
set(input_configs ${DOTCONFIG} ${FORCED_CONF_FILE})
endif()
Expand Down
Loading