Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CMake dependencies on mlir-linalg-ods-yaml-gen (llvm#111973)
Fix a number of dependencies issue to build mlir-linalg-ods-yaml-gen host binary which make a cross-build using the Make generator fail. Namely: - do not use binary path for the custom target created when LLVM_USE_HOST_TOOLS is true; - use target name instead of name of variable holding the target name for add_custom_target and set_target_properties in setup_host_tool(); - remove dependency on target defined in different directory in add_linalg_ods_yaml_gen() since add_custom_target DEPENDS can only be used on "files and outputs of custom commands created with add_custom_command() command calls in the same directory"; - remove unneeded dependency on ${MLIR_LINALG_ODS_YAML_GEN_EXE}, the target dependency will ensure the binary will be built. Note that we keep using ${MLIR_LINALG_ODS_YAML_GEN_EXE} in the COMMAND rather than use ${MLIR_LINALG_ODS_YAML_GEN_TARGET} because when LLVM_NATIVE_TOOL_DIR is used the latter is an empty string. Testing-wise, all three codepaths in get_host_tool_path() were tested with both GNU Make and Ninja generators: - cross-compiling with LLVM_NATIVE_TOOL_DIR checks the if path; - cross-compiling without LLVM_NATIVE_TOOL_DIR checks the elseif path; - native build without LLVM_NATIVE_TOOL_DIR checks the else path.
- Loading branch information