Changing iree-tblgen to not require alwayslink.
diff --git a/iree/compiler/Dialect/IREE/Tools/BUILD b/iree/compiler/Dialect/IREE/Tools/BUILD
index f046f8e..0411cff 100644
--- a/iree/compiler/Dialect/IREE/Tools/BUILD
+++ b/iree/compiler/Dialect/IREE/Tools/BUILD
@@ -18,16 +18,9 @@
licenses = ["notice"], # Apache 2.0
)
-cc_library(
- name = "Tools",
+filegroup(
+ name = "GenSrcs",
srcs = [
"StructAttrGen.cpp",
],
- deps = [
- "@llvm-project//llvm:Support",
- "@llvm-project//llvm:TableGen",
- "@llvm-project//mlir:Support",
- "@llvm-project//mlir:TableGen",
- ],
- alwayslink = 1,
)
diff --git a/iree/compiler/Dialect/IREE/Tools/CMakeLists.txt b/iree/compiler/Dialect/IREE/Tools/CMakeLists.txt
index 620c3a1..8b864e5 100644
--- a/iree/compiler/Dialect/IREE/Tools/CMakeLists.txt
+++ b/iree/compiler/Dialect/IREE/Tools/CMakeLists.txt
@@ -13,17 +13,3 @@
# limitations under the License.
iree_add_all_subdirs()
-
-iree_cc_library(
- NAME
- Tools
- SRCS
- "StructAttrGen.cpp"
- DEPS
- LLVMSupport
- LLVMTableGen
- MLIRSupport
- MLIRTableGen
- ALWAYSLINK
- PUBLIC
-)
diff --git a/iree/compiler/Dialect/VM/Tools/BUILD b/iree/compiler/Dialect/VM/Tools/BUILD
index b31b9f9..1b0c741 100644
--- a/iree/compiler/Dialect/VM/Tools/BUILD
+++ b/iree/compiler/Dialect/VM/Tools/BUILD
@@ -18,17 +18,10 @@
licenses = ["notice"], # Apache 2.0
)
-cc_library(
- name = "Tools",
+filegroup(
+ name = "GenSrcs",
srcs = [
"VMOpEncoderGen.cpp",
"VMOpTableGen.cpp",
],
- deps = [
- "@llvm-project//llvm:Support",
- "@llvm-project//llvm:TableGen",
- "@llvm-project//mlir:Support",
- "@llvm-project//mlir:TableGen",
- ],
- alwayslink = 1,
)
diff --git a/iree/compiler/Dialect/VM/Tools/CMakeLists.txt b/iree/compiler/Dialect/VM/Tools/CMakeLists.txt
index d13afd5..8b864e5 100644
--- a/iree/compiler/Dialect/VM/Tools/CMakeLists.txt
+++ b/iree/compiler/Dialect/VM/Tools/CMakeLists.txt
@@ -13,18 +13,3 @@
# limitations under the License.
iree_add_all_subdirs()
-
-iree_cc_library(
- NAME
- Tools
- SRCS
- "VMOpEncoderGen.cpp"
- "VMOpTableGen.cpp"
- DEPS
- LLVMSupport
- LLVMTableGen
- MLIRSupport
- MLIRTableGen
- ALWAYSLINK
- PUBLIC
-)
diff --git a/iree/tools/BUILD b/iree/tools/BUILD
index 81f1115..58414e6 100644
--- a/iree/tools/BUILD
+++ b/iree/tools/BUILD
@@ -264,10 +264,14 @@
cc_binary(
name = "iree-tblgen",
+ srcs = [
+ "//iree/compiler/Dialect/IREE/Tools:GenSrcs",
+ "//iree/compiler/Dialect/VM/Tools:GenSrcs",
+ ],
tags = ["hostonly"],
deps = [
- "//iree/compiler/Dialect/IREE/Tools",
- "//iree/compiler/Dialect/VM/Tools",
+ "@llvm-project//llvm:Support",
+ "@llvm-project//llvm:TableGen",
"@llvm-project//mlir:MlirTableGenMain",
"@llvm-project//mlir:Support",
"@llvm-project//mlir:TableGen",
diff --git a/iree/tools/CMakeLists.txt b/iree/tools/CMakeLists.txt
index b25478a..0cab4db 100644
--- a/iree/tools/CMakeLists.txt
+++ b/iree/tools/CMakeLists.txt
@@ -120,11 +120,14 @@
iree-tblgen
SRCS
"${IREE_ROOT_DIR}/third_party/llvm-project/mlir/tools/mlir-tblgen/mlir-tblgen.cpp"
+ "${IREE_SOURCE_DIR}/iree/compiler/Dialect/IREE/Tools/StructAttrGen.cpp"
+ "${IREE_SOURCE_DIR}/iree/compiler/Dialect/VM/Tools/VMOpEncoderGen.cpp"
+ "${IREE_SOURCE_DIR}/iree/compiler/Dialect/VM/Tools/VMOpTableGen.cpp"
DEPS
+ LLVMSupport
+ LLVMTableGen
MLIRSupport
MLIRTableGen
- iree::compiler::Dialect::IREE::Tools
- iree::compiler::Dialect::VM::Tools
HOSTONLY
)
endif()