Skip to content

Commit

Permalink
[luci/tests] Use cmake variable for tools command (#8422)
Browse files Browse the repository at this point in the history
This will revise to use cmake variables for circlechef-file,
tflchef-file and tflite2circle tools.

ONE-DCO-1.0-Signed-off-by: SaeHie Park <[email protected]>
  • Loading branch information
seanshpark authored Feb 16, 2022
1 parent 260fd28 commit ee20678
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions compiler/luci/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
set(CIRCLECHEF_FILE_PATH $<TARGET_FILE:circlechef-file>)
set(TFLCHEF_FILE_PATH $<TARGET_FILE:tflchef-file>)
set(TFLITE2CIRCLE_PATH $<TARGET_FILE:tflite2circle>)

# TODO use local test.recipe files for small networks
file(GLOB RECIPES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*/test.recipe")

Expand All @@ -17,14 +21,14 @@ foreach(RECIPE IN ITEMS ${RECIPES})

# Generate .tflite
add_custom_command(OUTPUT "${RECIPE_OUTPUT_FILE}"
COMMAND tflchef-file "${RECIPE_SOURCE_FILE}" "${RECIPE_OUTPUT_FILE}"
DEPENDS tflchef-file "${RECIPE_SOURCE_FILE}"
COMMAND ${TFLCHEF_FILE_PATH} "${RECIPE_SOURCE_FILE}" "${RECIPE_OUTPUT_FILE}"
DEPENDS ${TFLCHEF_FILE_PATH} "${RECIPE_SOURCE_FILE}"
COMMENT "Generating ${RECIPE_OUTPUT_FILE}")

# Generate .circle
add_custom_command(OUTPUT "${CIRCLE_OUTPUT_FILE}"
COMMAND tflite2circle "${RECIPE_OUTPUT_FILE}" "${CIRCLE_OUTPUT_FILE}"
DEPENDS tflite2circle "${RECIPE_OUTPUT_FILE}"
COMMAND ${TFLITE2CIRCLE_PATH} "${RECIPE_OUTPUT_FILE}" "${CIRCLE_OUTPUT_FILE}"
DEPENDS ${TFLITE2CIRCLE_PATH} "${RECIPE_OUTPUT_FILE}"
COMMENT "Generating ${CIRCLE_OUTPUT_FILE}")

list(APPEND TESTFILES "${CIRCLE_OUTPUT_FILE}")
Expand Down Expand Up @@ -52,14 +56,14 @@ foreach(RECIPE IN ITEMS ${RECIPES})

# Generate .tflite
add_custom_command(OUTPUT "${RECIPE_OUTPUT_FILE}"
COMMAND tflchef-file "${RECIPE_SOURCE_FILE}" "${RECIPE_OUTPUT_FILE}"
DEPENDS tflchef-file "${RECIPE_SOURCE_FILE}"
COMMAND ${TFLCHEF_FILE_PATH} "${RECIPE_SOURCE_FILE}" "${RECIPE_OUTPUT_FILE}"
DEPENDS ${TFLCHEF_FILE_PATH} "${RECIPE_SOURCE_FILE}"
COMMENT "Generating ${RECIPE_OUTPUT_FILE}")

# Generate .circle
add_custom_command(OUTPUT "${CIRCLE_OUTPUT_FILE}"
COMMAND tflite2circle "${RECIPE_OUTPUT_FILE}" "${CIRCLE_OUTPUT_FILE}"
DEPENDS tflite2circle "${RECIPE_OUTPUT_FILE}"
COMMAND ${TFLITE2CIRCLE_PATH} "${RECIPE_OUTPUT_FILE}" "${CIRCLE_OUTPUT_FILE}"
DEPENDS ${TFLITE2CIRCLE_PATH} "${RECIPE_OUTPUT_FILE}"
COMMENT "Generating ${CIRCLE_OUTPUT_FILE}")

list(APPEND TESTFILES "${CIRCLE_OUTPUT_FILE}")
Expand Down Expand Up @@ -87,8 +91,8 @@ foreach(RECIPE IN ITEMS ${RECIPES2})

# Generate .circle
add_custom_command(OUTPUT "${CIRCLE_OUTPUT_FILE}"
COMMAND circlechef-file "${RECIPE_SOURCE_FILE}" "${CIRCLE_OUTPUT_FILE}"
DEPENDS circlechef-file "${RECIPE_SOURCE_FILE}"
COMMAND ${CIRCLECHEF_FILE_PATH} "${RECIPE_SOURCE_FILE}" "${CIRCLE_OUTPUT_FILE}"
DEPENDS ${CIRCLECHEF_FILE_PATH} "${RECIPE_SOURCE_FILE}"
COMMENT "Generating ${CIRCLE_OUTPUT_FILE}")

list(APPEND TESTFILES "${CIRCLE_OUTPUT_FILE}")
Expand Down

0 comments on commit ee20678

Please sign in to comment.