[all-commits] [llvm/llvm-project] 32ef41: Fix CMake dependencies on mlir-linalg-ods-yaml-gen...

RoboTux via All-commits all-commits at lists.llvm.org
Thu Nov 28 03:30:23 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 32ef417603e1b747c2be946f8193fdb7c31d957e
      https://github.com/llvm/llvm-project/commit/32ef417603e1b747c2be946f8193fdb7c31d957e
  Author: Thomas Preud'homme <thomas.preudhomme at arm.com>
  Date:   2024-11-28 (Thu, 28 Nov 2024)

  Changed paths:
    M llvm/cmake/modules/AddLLVM.cmake
    M mlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt

  Log Message:
  -----------
  Fix CMake dependencies on mlir-linalg-ods-yaml-gen (#113565)

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();
- force setting of executable and target cache variable which are only
  used as global variables;
- 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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list