From 260fd28da2bbbfca2fb30c4f7f36b85cf8b56ed5 Mon Sep 17 00:00:00 2001 From: SaeHie Park Date: Wed, 16 Feb 2022 11:28:50 +0900 Subject: [PATCH] [circlechef] Use cmake variable for tools command (#8421) This will revise to use cmake variables for circlechef-file and circlechef-reverse tools. ONE-DCO-1.0-Signed-off-by: SaeHie Park --- compiler/circlechef/tests/CMakeLists.txt | 27 +++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/compiler/circlechef/tests/CMakeLists.txt b/compiler/circlechef/tests/CMakeLists.txt index 773ff54031d..3dffe1ebb6d 100644 --- a/compiler/circlechef/tests/CMakeLists.txt +++ b/compiler/circlechef/tests/CMakeLists.txt @@ -3,6 +3,9 @@ set(CIRCLERECIPES_DIR "${CircleRecipes_DIR}") file(GLOB RECIPES RELATIVE ${CIRCLERECIPES_DIR} "${CIRCLERECIPES_DIR}/*/test.recipe") +set(CIRCLECHEF_FILE_PATH $) +set(CIRCLECHEF_REVERSE_PATH $) + foreach(RECIPE IN ITEMS ${RECIPES}) get_filename_component(RECIPE_PREFIX ${RECIPE} DIRECTORY) @@ -18,8 +21,8 @@ foreach(RECIPE IN ITEMS ${RECIPES}) # Generate .circle add_custom_command(OUTPUT ${RECIPE_OUTPUT_FILE} - COMMAND circlechef-file ${RECIPE_SOURCE_FILE} ${RECIPE_OUTPUT_FILE} - DEPENDS circlechef-file ${RECIPE_SOURCE_FILE} + COMMAND ${CIRCLECHEF_FILE_PATH} ${RECIPE_SOURCE_FILE} ${RECIPE_OUTPUT_FILE} + DEPENDS ${CIRCLECHEF_FILE_PATH} ${RECIPE_SOURCE_FILE} COMMENT "Generating ${RECIPE_OUTPUT_FILE}") list(APPEND TESTS ${RECIPE_PREFIX}) @@ -44,8 +47,8 @@ foreach(RECIPE IN ITEMS ${RECIPES}) # Generate .circle add_custom_command(OUTPUT ${RECIPE_OUTPUT_FILE} - COMMAND circlechef-file ${RECIPE_SOURCE_FILE} ${RECIPE_OUTPUT_FILE} - DEPENDS circlechef-file ${RECIPE_SOURCE_FILE} + COMMAND ${CIRCLECHEF_FILE_PATH} ${RECIPE_SOURCE_FILE} ${RECIPE_OUTPUT_FILE} + DEPENDS ${CIRCLECHEF_FILE_PATH} ${RECIPE_SOURCE_FILE} COMMENT "Generating ${RECIPE_OUTPUT_FILE}") list(APPEND TESTS ${RECIPE_PREFIX}) @@ -68,16 +71,16 @@ foreach(CIRCLEFILE IN ITEMS ${GEN_CIRCLEFILES}) # Generate .gen.recipe from generated .circle add_custom_command(OUTPUT ${RECIPE_GEN_OUTPUT_FILE} - COMMAND circlechef-reverse ${RECIPE_OUTPUT_FILE} ${RECIPE_GEN_OUTPUT_FILE} - DEPENDS circlechef-reverse ${RECIPE_OUTPUT_FILE} + COMMAND ${CIRCLECHEF_REVERSE_PATH} ${RECIPE_OUTPUT_FILE} ${RECIPE_GEN_OUTPUT_FILE} + DEPENDS ${CIRCLECHEF_REVERSE_PATH} ${RECIPE_OUTPUT_FILE} COMMENT "Generating ${RECIPE_GEN_OUTPUT_FILE}") # now we are going to generate .gen.circle from .gen.recipe # to check generated .gen.recipe file is correct by using it. # as weight values may be different, binary comparision is not acceptable. add_custom_command(OUTPUT ${RECIPE_GEN_OUTPUT_FILE2} - COMMAND circlechef-file ${RECIPE_GEN_OUTPUT_FILE} ${RECIPE_GEN_OUTPUT_FILE2} - DEPENDS circlechef-file ${RECIPE_GEN_OUTPUT_FILE} + COMMAND ${CIRCLECHEF_FILE_PATH} ${RECIPE_GEN_OUTPUT_FILE} ${RECIPE_GEN_OUTPUT_FILE2} + DEPENDS ${CIRCLECHEF_FILE_PATH} ${RECIPE_GEN_OUTPUT_FILE} COMMENT "Generating ${RECIPE_GEN_OUTPUT_FILE2}") list(APPEND TESTS ${CIRCLE_PREFIX}.gen) @@ -96,13 +99,13 @@ foreach(CIRCLEFILE IN ITEMS ${GEN_CIRCLEFILES}) # Generate .gen.recipe from generated .circle add_custom_command(OUTPUT ${RECIPE_GEN_OUTPUT_FILE} - COMMAND circlechef-reverse ${RECIPE_OUTPUT_FILE} ${RECIPE_GEN_OUTPUT_FILE} - DEPENDS circlechef-reverse ${RECIPE_OUTPUT_FILE} + COMMAND ${CIRCLECHEF_REVERSE_PATH} ${RECIPE_OUTPUT_FILE} ${RECIPE_GEN_OUTPUT_FILE} + DEPENDS ${CIRCLECHEF_REVERSE_PATH} ${RECIPE_OUTPUT_FILE} COMMENT "Generating ${RECIPE_GEN_OUTPUT_FILE}") add_custom_command(OUTPUT ${RECIPE_GEN_OUTPUT_FILE2} - COMMAND circlechef-file ${RECIPE_GEN_OUTPUT_FILE} ${RECIPE_GEN_OUTPUT_FILE2} - DEPENDS circlechef-file ${RECIPE_GEN_OUTPUT_FILE} + COMMAND ${CIRCLECHEF_FILE_PATH} ${RECIPE_GEN_OUTPUT_FILE} ${RECIPE_GEN_OUTPUT_FILE2} + DEPENDS ${CIRCLECHEF_FILE_PATH} ${RECIPE_GEN_OUTPUT_FILE} COMMENT "Generating ${RECIPE_GEN_OUTPUT_FILE2}") list(APPEND TESTS ${CIRCLE_PREFIX}.gen)