Fix flatcc target name and binary path (#2599)
This commit also defines iree_host_build_flatcc_cli when not
cross compiling so we can depend on it in iree_flatbuffer_c_library.
Also copy flatcc_cli from the proper place. They install it
in the source directory...
Co-authored-by: Lei Zhang <antiagainst@google.com>
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 85dc183..359d641 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -368,11 +368,14 @@
add_custom_target(iree_host_flatcc_cli
COMMAND
"${CMAKE_COMMAND}" -E copy_if_different
- "${IREE_HOST_BINARY_ROOT}/third_party/flatcc/flatcc${IREE_HOST_EXECUTABLE_SUFFIX}"
+ "${PROJECT_SOURCE_DIR}/third_party/flatcc/bin/flatcc${IREE_HOST_EXECUTABLE_SUFFIX}"
"${IREE_HOST_BINARY_ROOT}/bin/flatcc_cli"
DEPENDS iree_host_build_flatcc_cli
COMMENT "Installing host flatcc..."
)
+else()
+ # TODO: unify flatc and flatcc handling to the same mechanism.
+ add_executable(iree_host_flatcc_cli ALIAS flatcc_cli)
endif()
if(${IREE_BUILD_COMPILER})