[Mlir-commits] [mlir] 6e31a6b - fix linalg ods gen cross compiling like other gen executables
Mehdi Amini
llvmlistbot at llvm.org
Sat Feb 13 11:17:57 PST 2021
Author: daquexian
Date: 2021-02-13T19:17:46Z
New Revision: 6e31a6b7c25fba070a3290dd8fba9ad2e47ba30d
URL: https://github.com/llvm/llvm-project/commit/6e31a6b7c25fba070a3290dd8fba9ad2e47ba30d
DIFF: https://github.com/llvm/llvm-project/commit/6e31a6b7c25fba070a3290dd8fba9ad2e47ba30d.diff
LOG: fix linalg ods gen cross compiling like other gen executables
Signed-off-by: daquexian <daquexian566 at gmail.com>
Reviewed By: vinograd47
Differential Revision: https://reviews.llvm.org/D96645
Added:
Modified:
mlir/tools/mlir-linalg-ods-gen/CMakeLists.txt
Removed:
################################################################################
diff --git a/mlir/tools/mlir-linalg-ods-gen/CMakeLists.txt b/mlir/tools/mlir-linalg-ods-gen/CMakeLists.txt
index 7a0f79798268..22b350a10ac2 100644
--- a/mlir/tools/mlir-linalg-ods-gen/CMakeLists.txt
+++ b/mlir/tools/mlir-linalg-ods-gen/CMakeLists.txt
@@ -11,17 +11,22 @@ target_link_libraries(mlir-linalg-ods-gen PRIVATE
MLIRIR
)
-set(MLIR_LINALG_ODS_GEN_EXE mlir-linalg-ods-gen PARENT_SCOPE)
+set(MLIR_LINALG_ODS_GEN mlir-linalg-ods-gen CACHE
+ STRING "Native mlir-linalg-ods-gen executable. Saves building one when cross-compiling.")
+
+set(MLIR_LINALG_ODS_GEN_EXE ${MLIR_LINALG_ODS_GEN} PARENT_SCOPE)
set(MLIR_LINALG_ODS_GEN_TARGET mlir-linalg-ods-gen PARENT_SCOPE)
if(LLVM_USE_HOST_TOOLS)
- build_native_tool(mlir-linalg-ods-gen MLIR_LINALG_ODS_GEN_EXE DEPENDS mlir-linalg-ods-gen)
- set(MLIR_LINALG_ODS_GEN_EXE ${MLIR_LINALG_ODS_GEN_EXE} PARENT_SCOPE)
+ if (${MLIR_LINALG_ODS_GEN_EXE} STREQUAL mlir-linalg-ods-gen)
+ build_native_tool(mlir-linalg-ods-gen MLIR_LINALG_ODS_GEN_EXE DEPENDS mlir-linalg-ods-gen)
+ set(MLIR_LINALG_ODS_GEN_EXE ${MLIR_LINALG_ODS_GEN_EXE} PARENT_SCOPE)
- add_custom_target(mlir-linalg-ods-gen-host DEPENDS ${MLIR_LINALG_ODS_GEN_EXE})
- set(MLIR_LINALG_ODS_GEN_TARGET mlir-linalg-ods-gen-host DEPENDS PARENT_SCOPE)
+ add_custom_target(mlir-linalg-ods-gen-host DEPENDS ${MLIR_LINALG_ODS_GEN_EXE})
+ set(MLIR_LINALG_ODS_GEN_TARGET mlir-linalg-ods-gen-host DEPENDS PARENT_SCOPE)
- if(NOT LLVM_BUILD_UTILS)
- set_target_properties(mlir-linalg-ods-gen PROPERTIES EXCLUDE_FROM_ALL ON)
+ if(NOT LLVM_BUILD_UTILS)
+ set_target_properties(mlir-linalg-ods-gen PROPERTIES EXCLUDE_FROM_ALL ON)
+ endif()
endif()
endif()
More information about the Mlir-commits
mailing list