Skip to content

Commit

Permalink
dts: cmake: merge vendor prefixes files
Browse files Browse the repository at this point in the history
Before the Devicetree document can be built, the two files with the
vendor prefixes from the Zephyr and Bridle folders will must be merged.

Signed-off-by: Stephan Linz <[email protected]>
  • Loading branch information
rexut committed Jun 17, 2024
1 parent f87d926 commit 2be2ab8
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,32 @@ add_dependencies(zephyr-html-all
#-------------------------------------------------------------------------------
# docset: devicetree

set(devicetree_bvp_files
${ZEPHYR_BASE}/dts/bindings/vendor-prefixes.txt
${BRIDLE_BASE}/dts/bindings/vendor-prefixes.txt
)
string(REPLACE ";" "\\;" devicetree_bvp_files_escaped "${devicetree_bvp_files}")

add_custom_command(
OUTPUT ${DTS_BINDINGS_BINARY_DIR}/vendor-prefixes.txt
DEPENDS
${devicetree_bvp_files}
COMMAND ${CMAKE_COMMAND}
-DIN_FILES="${devicetree_bvp_files_escaped}"
-DOUT_FILE=${DTS_BINDINGS_BINARY_DIR}/vendor-prefixes.txt
-P ${BRIDLE_BASE}/doc/update_appends.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
COMMENT "Update vendor-prefixes.txt in ${DTS_BINDINGS_BINARY_DIR}"
USES_TERMINAL
)

add_custom_target(
devicetree-vendor-prefixes
DEPENDS
${DTS_BINDINGS_BINARY_DIR}/vendor-prefixes.txt
COMMENT "Generating vendor prefixes list for devicetree"
)

# The devicetree bindings discovered in ${DTS_ROOTS} are parsed and
# documentation for them is generated in the directory
# ${DTS_BINDINGS_RST_OUT}.
Expand Down Expand Up @@ -378,7 +404,7 @@ add_custom_target(
GEN_DEVICETREE_REST_ZEPHYR_DOCSET=${GEN_DEVICETREE_REST_ZEPHYR_DOCSET}
${PYTHON_EXECUTABLE}
${GEN_DEVICETREE_REST_SCRIPT}
--vendor-prefixes ${ZEPHYR_BASE}/dts/bindings/vendor-prefixes.txt
--vendor-prefixes ${DTS_BINDINGS_BINARY_DIR}/vendor-prefixes.txt
${DTS_ROOT_ARGS} ${DTS_BINDINGS_RST_OUT}
VERBATIM
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
Expand All @@ -390,6 +416,7 @@ set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${GEN_DEVICETREE_

add_docset(devicetree "")

add_dependencies(devicetree-content devicetree-vendor-prefixes)
add_dependencies(devicetree-inventory devicetree-content)
add_dependencies(devicetree-html devicetree-content)
add_dependencies(devicetree-html-all
Expand Down Expand Up @@ -449,7 +476,7 @@ add_custom_target(
bridle-versions
DEPENDS
${BRIDLE_BINARY_DIR}/src/versions.txt
COMMENT "Generating version lists for bridle"
COMMENT "Generating versions list for bridle"
)

add_docset(bridle "-j 1" API) # no parallel reading, because of sphinx-csv-filter
Expand Down

0 comments on commit 2be2ab8

Please sign in to comment.