Index: mlir/CMakeLists.txt =================================================================== --- mlir/CMakeLists.txt +++ 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}) @@ -53,6 +52,11 @@ 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(tools) Index: mlir/tools/CMakeLists.txt =================================================================== --- mlir/tools/CMakeLists.txt +++ mlir/tools/CMakeLists.txt @@ -1,6 +1,5 @@ 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)