Add json merger tool
Add a simple script to merge two json files. It's necessary for creating
the sp_layout.json required by TF-A for using FIP SPs.
Signed-off-by: Balint Dobszay <balint.dobszay@arm.com>
Change-Id: I944770d263921efcbb12217db3df5170c59f8fec
diff --git a/tools/cmake/common/ExportSp.cmake b/tools/cmake/common/ExportSp.cmake
index eeac256..faa69fe 100644
--- a/tools/cmake/common/ExportSp.cmake
+++ b/tools/cmake/common/ExportSp.cmake
@@ -92,5 +92,11 @@
if (DEFINED EXPORT_JSON_IN)
configure_file(${EXPORT_JSON_IN} ${CMAKE_CURRENT_BINARY_DIR}/${EXPORT_SP_NAME}.json @ONLY NEWLINE_STYLE UNIX)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${EXPORT_SP_NAME}.json DESTINATION ${TS_ENV}/json)
+
+ find_package(Python3 REQUIRED COMPONENTS Interpreter)
+ execute_process(COMMAND ${Python3_EXECUTABLE} ${TS_ROOT}/tools/python/merge_json.py
+ ${CMAKE_INSTALL_PREFIX}/${TS_ENV}/json/sp_layout.json
+ ${CMAKE_CURRENT_BINARY_DIR}/${EXPORT_SP_NAME}.json
+ )
endif()
endfunction()