Skip to content

Commit

Permalink
[mlir] Fix cross compiling MLIR
Browse files Browse the repository at this point in the history
Setting MLIR_TABLEGEN_EXE would prevent building the native tool which is used in cross-compiling

Differential Revision: https://reviews.llvm.org/D75299
  • Loading branch information
isuruf authored and Mehdi Amini committed Mar 14, 2020
1 parent 04410c5 commit 103678d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 5 additions & 1 deletion 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})
Expand Down Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion 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)

0 comments on commit 103678d

Please sign in to comment.