aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Åstrand <per.astrand@arm.com>2021-03-26 09:52:07 +0100
committerKristofer Jonsson <kristofer.jonsson@arm.com>2021-05-04 07:50:25 +0000
commit0954a8a3c5e54ff086c529d5ec00d5c6a80dbc59 (patch)
tree1696e4b2325d8ee6d9322d692647aca9064edd83
parent43a840972865be5b8a6a9ca1b4fa95d695db2fe6 (diff)
downloadethos-u-core-platform-0954a8a3c5e54ff086c529d5ec00d5c6a80dbc59.tar.gz
Generate binaries for all executables
Add helper to generate binaries for all targets added with ethosu_add_executable in order to ease development on fpga. Change-Id: I23df4f8aa1fd2d8a1e633d337b9f09ad7fe75774
-rw-r--r--cmake/helpers.cmake15
-rw-r--r--targets/corstone-300/CMakeLists.txt2
2 files changed, 17 insertions, 0 deletions
diff --git a/cmake/helpers.cmake b/cmake/helpers.cmake
index 389deb9..8676cd3 100644
--- a/cmake/helpers.cmake
+++ b/cmake/helpers.cmake
@@ -89,6 +89,8 @@ function(ethosu_add_executable target)
${ARGS_TARGET_LIBRARY} ethosu_core ${ARGS_LIBRARIES})
ethosu_eval_link_options(${target})
+
+ ethosu_add_binaries(${target})
endfunction()
#############################################################################
@@ -122,3 +124,16 @@ function(ethosu_add_executable_test target)
ethosu_add_executable(${target} ${ARGN})
ethosu_add_test(${target} ${ARGN})
endfunction()
+
+#############################################################################
+# Generate binaries
+#############################################################################
+
+function(ethosu_add_binaries target)
+ add_custom_command(TARGET ${target} POST_BUILD
+ COMMAND ${SCRIPTS_DIR}/generate_binaries.py --output ./fw $<TARGET_FILE:${target}>
+ BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/fw/*
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMENT "Generate binaries for ${target}")
+
+endfunction()
diff --git a/targets/corstone-300/CMakeLists.txt b/targets/corstone-300/CMakeLists.txt
index e791cfd..a9e69ec 100644
--- a/targets/corstone-300/CMakeLists.txt
+++ b/targets/corstone-300/CMakeLists.txt
@@ -42,6 +42,8 @@ include(CTest)
include(${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/helpers.cmake)
+set(SCRIPTS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts)
+
#############################################################################
# Corstone-300
#############################################################################