[Mlir-commits] [mlir] 103678d - [mlir] Fix cross compiling MLIR
Mehdi Amini
llvmlistbot at llvm.org
Sat Mar 14 12:18:49 PDT 2020
Author: Isuru Fernando
Date: 2020-03-14T19:18:40Z
New Revision: 103678d66a9e847b1009533765ee563f8d623f63
URL: https://github.com/llvm/llvm-project/commit/103678d66a9e847b1009533765ee563f8d623f63
DIFF: https://github.com/llvm/llvm-project/commit/103678d66a9e847b1009533765ee563f8d623f63.diff
LOG: [mlir] Fix cross compiling MLIR
Setting MLIR_TABLEGEN_EXE would prevent building the native tool which is used in cross-compiling
Differential Revision: https://reviews.llvm.org/D75299
Added:
Modified:
mlir/CMakeLists.txt
mlir/tools/CMakeLists.txt
Removed:
################################################################################
diff --git a/mlir/CMakeLists.txt b/mlir/CMakeLists.txt
index 50c1223a4a10..e05733b2cb3f 100644
--- a/mlir/CMakeLists.txt
+++ b/mlir/CMakeLists.txt
@@ -1,7 +1,6 @@
# MLIR project.
set(MLIR_MAIN_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include ) # --src-root
set(MLIR_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/include ) # --includedir
-set(MLIR_TABLEGEN_EXE mlir-tblgen)
set(MLIR_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(MLIR_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
@@ -32,6 +31,11 @@ set(MLIR_VULKAN_RUNNER_ENABLED 0 CACHE BOOL "Enable building the mlir Vulkan run
include_directories( "include")
include_directories( ${MLIR_INCLUDE_DIR})
+# Adding tools/mlir-tblgen here as calling add_tablegen sets some variables like
+# MLIR_TABLEGEN_EXE in PARENT_SCOPE which gets lost if that folder is included
+# from another directory like tools
+add_subdirectory(tools/mlir-tblgen)
+
add_subdirectory(include/mlir)
add_subdirectory(lib)
add_subdirectory(unittests)
diff --git a/mlir/tools/CMakeLists.txt b/mlir/tools/CMakeLists.txt
index 1fd89450f3f9..5c0125c270d8 100644
--- a/mlir/tools/CMakeLists.txt
+++ b/mlir/tools/CMakeLists.txt
@@ -1,7 +1,6 @@
add_subdirectory(mlir-cuda-runner)
add_subdirectory(mlir-cpu-runner)
add_subdirectory(mlir-opt)
-add_subdirectory(mlir-tblgen)
add_subdirectory(mlir-translate)
add_subdirectory(mlir-vulkan-runner)
add_subdirectory(mlir-shlib)
More information about the Mlir-commits
mailing list