aboutsummaryrefslogtreecommitdiff
path: root/cmake/helpers.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/helpers.cmake')
-rw-r--r--cmake/helpers.cmake15
1 files changed, 15 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()