[PATCH] D131282: [mlir] fix `add_tablegen()` macro to allow installing mlir-pdll
Ashay Rane via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 7 15:49:30 PDT 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGd1bb3016ddc8: [mlir] fix `add_tablegen()` macro to allow installing mlir-pdll (authored by ashay).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D131282/new/
https://reviews.llvm.org/D131282
Files:
clang/utils/TableGen/CMakeLists.txt
llvm/cmake/modules/TableGen.cmake
llvm/utils/TableGen/CMakeLists.txt
mlir/tools/mlir-pdll/CMakeLists.txt
mlir/tools/mlir-tblgen/CMakeLists.txt
Index: mlir/tools/mlir-tblgen/CMakeLists.txt
===================================================================
--- mlir/tools/mlir-tblgen/CMakeLists.txt
+++ mlir/tools/mlir-tblgen/CMakeLists.txt
@@ -4,7 +4,7 @@
TableGen
)
-add_tablegen(mlir-tblgen MLIR
+add_tablegen(mlir-tblgen MLIR DESTINATION "${MLIR_TOOLS_INSTALL_DIR}"
AttrOrTypeDefGen.cpp
AttrOrTypeFormatGen.cpp
CodeGenHelpers.cpp
Index: mlir/tools/mlir-pdll/CMakeLists.txt
===================================================================
--- mlir/tools/mlir-pdll/CMakeLists.txt
+++ mlir/tools/mlir-pdll/CMakeLists.txt
@@ -12,7 +12,7 @@
MLIRPDLLParser
)
-add_tablegen(mlir-pdll MLIR_PDLL
+add_tablegen(mlir-pdll MLIR_PDLL DESTINATION "${MLIR_TOOLS_INSTALL_DIR}"
mlir-pdll.cpp
DEPENDS
Index: llvm/utils/TableGen/CMakeLists.txt
===================================================================
--- llvm/utils/TableGen/CMakeLists.txt
+++ llvm/utils/TableGen/CMakeLists.txt
@@ -2,7 +2,7 @@
set(LLVM_LINK_COMPONENTS Support)
-add_tablegen(llvm-tblgen LLVM
+add_tablegen(llvm-tblgen LLVM DESTINATION "${LLVM_TOOLS_INSTALL_DIR}"
AsmMatcherEmitter.cpp
AsmWriterEmitter.cpp
AsmWriterInst.cpp
Index: llvm/cmake/modules/TableGen.cmake
===================================================================
--- llvm/cmake/modules/TableGen.cmake
+++ llvm/cmake/modules/TableGen.cmake
@@ -140,6 +140,8 @@
endfunction()
macro(add_tablegen target project)
+ cmake_parse_arguments(ADD_TABLEGEN "" "DESTINATION" "" ${ARGN})
+
set(${target}_OLD_LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS})
set(LLVM_LINK_COMPONENTS ${LLVM_LINK_COMPONENTS} TableGen)
@@ -149,7 +151,8 @@
set(LLVM_ENABLE_OBJLIB ON)
endif()
- add_llvm_executable(${target} DISABLE_LLVM_LINK_LLVM_DYLIB ${ARGN})
+ add_llvm_executable(${target} DISABLE_LLVM_LINK_LLVM_DYLIB
+ ${ADD_TABLEGEN_UNPARSED_ARGUMENTS})
set(LLVM_LINK_COMPONENTS ${${target}_OLD_LLVM_LINK_COMPONENTS})
set(${project}_TABLEGEN "${target}" CACHE
@@ -186,7 +189,7 @@
endif()
endif()
- if ((${project} STREQUAL LLVM OR ${project} STREQUAL MLIR) AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS)
+ if (ADD_TABLEGEN_DESTINATION AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY AND LLVM_BUILD_UTILS)
set(export_to_llvmexports)
if(${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
NOT LLVM_DISTRIBUTION_COMPONENTS)
@@ -196,7 +199,7 @@
install(TARGETS ${target}
${export_to_llvmexports}
COMPONENT ${target}
- RUNTIME DESTINATION "${${project}_TOOLS_INSTALL_DIR}")
+ RUNTIME DESTINATION "${ADD_TABLEGEN_DESTINATION}")
if(NOT LLVM_ENABLE_IDE)
add_llvm_install_targets("install-${target}"
DEPENDS ${target}
Index: clang/utils/TableGen/CMakeLists.txt
===================================================================
--- clang/utils/TableGen/CMakeLists.txt
+++ clang/utils/TableGen/CMakeLists.txt
@@ -1,6 +1,6 @@
set(LLVM_LINK_COMPONENTS Support)
-add_tablegen(clang-tblgen CLANG
+add_tablegen(clang-tblgen CLANG DESTINATION "${CLANG_TOOLS_INSTALL_DIR}"
ASTTableGen.cpp
ClangASTNodesEmitter.cpp
ClangASTPropertiesEmitter.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131282.450674.patch
Type: text/x-patch
Size: 3208 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220807/67e9c386/attachment.bin>
More information about the llvm-commits
mailing list