[all-commits] [llvm/llvm-project] 2241b3: [mlir][CMAKE] Fix cross-compilation build

Vladislav Vinogradov via All-commits all-commits at lists.llvm.org
Mon Mar 8 23:52:12 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2241b3986cd5b039c0de673866193948485242b6
      https://github.com/llvm/llvm-project/commit/2241b3986cd5b039c0de673866193948485242b6
  Author: Vladislav Vinogradov <vlad.vinogradov at intel.com>
  Date:   2021-03-09 (Tue, 09 Mar 2021)

  Changed paths:
    M mlir/tools/mlir-linalg-ods-gen/CMakeLists.txt

  Log Message:
  -----------
  [mlir][CMAKE] Fix cross-compilation build

Use `MLIR_LINALG_ODS_GEN` and `MLIR_LINALG_ODS_YAML_GEN` variables
instead of `MLIR_LINALG_ODS_GEN_EXE` and `MLIR_LINALG_ODS_YAML_GEN_EXE`.
The former are defined in PARENT SCOPE only, so the `if` condition
is never evaluates to `TRUE`.

The logic should be the following (taken from tblgen part):

1. `TOOL_NAME` - CACHE variable (default equal to target name).
   User can override it to actual executable path.
2. `TOOL_NAME_EXE` - internal variable, initialized to `${TOOL_NAME}` first.
   In case of cross-compilation (`LLVM_USE_HOST_TOOLS == TRUE`) if user
   didn't set own path to native executable via `TOOL_NAME` variable,
   CMake will create separate targets to build native tool and
   will override `TOOL_NAME_EXE` to the executable produced by this target.
3. `TOOL_NAME_TARGET` - internal variable, which points to tool target name.
   If the native tool is built as described above, it will point to the
   target correspondant to that native tool.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D98025




More information about the All-commits mailing list