CMake function to add all subdirectories
Rather than doing this as part of generating the files with bazel_to_cmake, we can just have each file add all its subdirectories. Only adds directories that have a CMakeLists.txt file (same as the current bazel_to_cmake logic).
Depends on https://github.com/google/iree/pull/1003
This has a few advantages:
1. We don't have to remember to update the CMakeLists file (or rerun bazel_to_cmake) when adding a directory.
2. Any directory's CMakeLists file is dependent only on the corresponding BUILD file (plus the previous version of the CMakeLists for instructions like "DO NOT EDIT" and the correct license year).
3. As a consequence of (2), there is no ordering dependence on the directories processed by bazel_to_cmake, so we can always only run it on directory's with modified BUILD files.
4. This makes it possible to integrate bazel_to_cmake as a hermetic genrule with in bazel (with a few additional tweaks).
It shifts more work onto the cmake side (away from generation), however. To make sure it doesn't increase build times as a result, I tested out the comparative build times on my workstation. There is no substantial difference. Also it still runs the same number of tests (and they all pass).
Configure only:
```shell
$ rm -rf build/ && mkdir build && cd build && time cmake -G Ninja -DCMAKE_BUILD_TYPE=FastBuild -DIREE_BUILD_COMPILER=ON -DIREE_BUILD_TESTS=ON -DIREE_BUILD_SAMPLES=OFF -DIREE_BUILD_DEBUGGER=OFF ..
```
Before:
```shell
real 0m25.487s
user 0m17.906s
sys 0m7.606s
```
After:
```shell
real 0m25.418s
user 0m17.844s
sys 0m7.599s
```
Clean build:
```shell
$ time ./build_tools/cmake/clean_build.sh
```
Before:
```shell
real 6m36.789s
user 63m54.858s
sys 3m52.994s
```
After:
```shell
real 6m38.352s
user 63m55.938s
sys 3m50.222s
```
Rebuild (no changes):
```shell
$ time ./build_tools/cmake/rebuild.sh
```
Before:
```shell
real 1m36.174s
user 13m7.361s
sys 1m2.658s
```
After:
```shell
real 1m35.235s
user 13m5.488s
sys 1m3.178s
```
Test
```shell
$ time ./build_tools/cmake/test.sh
```
Before:
```shell
100% tests passed, 0 tests failed out of 211
Total Test time (real) = 4.10 sec
real 0m4.140s
user 0m16.732s
sys 0m13.647s
```
After:
```shell
100% tests passed, 0 tests failed out of 211
Total Test time (real) = 4.04 sec
real 0m4.089s
user 0m16.738s
sys 0m13.516s
```
Closes https://github.com/google/iree/pull/1002
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/iree/pull/1002 from GMNGeoffrey:bazel-to-cmake 8c38f884ada0a83b038304dc9bbc7652c9487f39
PiperOrigin-RevId: 299888098
diff --git a/build_tools/bazel_to_cmake/bazel_to_cmake.py b/build_tools/bazel_to_cmake/bazel_to_cmake.py
index 49cc208..80c4772 100755
--- a/build_tools/bazel_to_cmake/bazel_to_cmake.py
+++ b/build_tools/bazel_to_cmake/bazel_to_cmake.py
@@ -574,18 +574,9 @@
self.first_error = None
def convert(self, copyright_line):
- # One `add_subdirectory(name)` per subdirectory.
- add_subdir_commands = []
- for root, dirs, _ in os.walk(self.directory_path):
- for d in sorted(dirs):
- if os.path.isfile(os.path.join(root, d, "CMakeLists.txt")):
- add_subdir_commands.append("add_subdirectory(%s)" % (d,))
- # Stop walk, only add direct subdirectories.
- break
-
converted_file = self.template % {
"copyright_line": copyright_line,
- "add_subdirectories": "\n".join(add_subdir_commands),
+ "add_subdirectories": "iree_add_all_subdirs()",
"body": self.body,
}
@@ -626,9 +617,7 @@
def convert_directory_tree(root_directory_path, write_files, strict):
print("convert_directory_tree: %s" % (root_directory_path,))
- # Process directories starting at leaves so we can skip add_directory on
- # subdirs without a CMakeLists file.
- for root, _, _ in os.walk(root_directory_path, topdown=False):
+ for root, _, _ in os.walk(root_directory_path):
convert_directory(root, write_files, strict)
diff --git a/build_tools/cmake/iree_add_all_subdirs.cmake b/build_tools/cmake/iree_add_all_subdirs.cmake
new file mode 100644
index 0000000..a106ec5
--- /dev/null
+++ b/build_tools/cmake/iree_add_all_subdirs.cmake
@@ -0,0 +1,33 @@
+# Copyright 2020 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# iree_add_all_subidrs
+#
+# CMake function to add all subdirectories of the current directory that contain
+# a CMakeLists.txt file
+#
+# Takes no arguments.
+function(iree_add_all_subdirs)
+ FILE(GLOB _CHILDREN RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*)
+ SET(_DIRLIST "")
+ foreach(_CHILD ${_CHILDREN})
+ if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${_CHILD} AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_CHILD}/CMakeLists.txt)
+ LIST(APPEND _DIRLIST ${_CHILD})
+ endif()
+ endforeach()
+
+ foreach(subdir ${_DIRLIST})
+ add_subdirectory(${subdir})
+ endforeach()
+endfunction()
diff --git a/iree/base/internal/CMakeLists.txt b/iree/base/internal/CMakeLists.txt
index f07b133..2a2c2dd 100644
--- a/iree/base/internal/CMakeLists.txt
+++ b/iree/base/internal/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
file_handle_win32
diff --git a/iree/compiler/CMakeLists.txt b/iree/compiler/CMakeLists.txt
index f2aa4ed..8b864e5 100644
--- a/iree/compiler/CMakeLists.txt
+++ b/iree/compiler/CMakeLists.txt
@@ -12,6 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(Dialect)
-add_subdirectory(Translation)
-add_subdirectory(Utils)
+iree_add_all_subdirs()
diff --git a/iree/compiler/Dialect/CMakeLists.txt b/iree/compiler/Dialect/CMakeLists.txt
index e081e9a..8b864e5 100644
--- a/iree/compiler/Dialect/CMakeLists.txt
+++ b/iree/compiler/Dialect/CMakeLists.txt
@@ -12,11 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(Flow)
-add_subdirectory(HAL)
-add_subdirectory(IREE)
-add_subdirectory(Modules)
-add_subdirectory(Shape)
-add_subdirectory(VM)
-add_subdirectory(VMLA)
-add_subdirectory(Vulkan)
+iree_add_all_subdirs()
diff --git a/iree/compiler/Dialect/Flow/Analysis/CMakeLists.txt b/iree/compiler/Dialect/Flow/Analysis/CMakeLists.txt
index 9e6a9c4..8c0fc53 100644
--- a/iree/compiler/Dialect/Flow/Analysis/CMakeLists.txt
+++ b/iree/compiler/Dialect/Flow/Analysis/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/Flow/Analysis/test/CMakeLists.txt b/iree/compiler/Dialect/Flow/Analysis/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/Flow/Analysis/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/Flow/Analysis/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/Flow/CMakeLists.txt b/iree/compiler/Dialect/Flow/CMakeLists.txt
index 32edb64..8b864e5 100644
--- a/iree/compiler/Dialect/Flow/CMakeLists.txt
+++ b/iree/compiler/Dialect/Flow/CMakeLists.txt
@@ -12,8 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(Analysis)
-add_subdirectory(Conversion)
-add_subdirectory(IR)
-add_subdirectory(Transforms)
-add_subdirectory(Utils)
+iree_add_all_subdirs()
diff --git a/iree/compiler/Dialect/Flow/Conversion/CMakeLists.txt b/iree/compiler/Dialect/Flow/Conversion/CMakeLists.txt
index 8bb979c..83c21fb 100644
--- a/iree/compiler/Dialect/Flow/Conversion/CMakeLists.txt
+++ b/iree/compiler/Dialect/Flow/Conversion/CMakeLists.txt
@@ -12,8 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(HLOToFlow)
-add_subdirectory(StandardToFlow)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/Flow/Conversion/HLOToFlow/CMakeLists.txt b/iree/compiler/Dialect/Flow/Conversion/HLOToFlow/CMakeLists.txt
index 7220449..18d36d2 100644
--- a/iree/compiler/Dialect/Flow/Conversion/HLOToFlow/CMakeLists.txt
+++ b/iree/compiler/Dialect/Flow/Conversion/HLOToFlow/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/Flow/Conversion/HLOToFlow/test/CMakeLists.txt b/iree/compiler/Dialect/Flow/Conversion/HLOToFlow/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/Flow/Conversion/HLOToFlow/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/Flow/Conversion/HLOToFlow/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/Flow/Conversion/StandardToFlow/CMakeLists.txt b/iree/compiler/Dialect/Flow/Conversion/StandardToFlow/CMakeLists.txt
index 29adf70..3ccff68 100644
--- a/iree/compiler/Dialect/Flow/Conversion/StandardToFlow/CMakeLists.txt
+++ b/iree/compiler/Dialect/Flow/Conversion/StandardToFlow/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/Flow/Conversion/StandardToFlow/test/CMakeLists.txt b/iree/compiler/Dialect/Flow/Conversion/StandardToFlow/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/Flow/Conversion/StandardToFlow/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/Flow/Conversion/StandardToFlow/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/Flow/IR/CMakeLists.txt b/iree/compiler/Dialect/Flow/IR/CMakeLists.txt
index 16950df..234da6c 100644
--- a/iree/compiler/Dialect/Flow/IR/CMakeLists.txt
+++ b/iree/compiler/Dialect/Flow/IR/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
file(GLOB _GLOB_X_TD CONFIGURE_DEPENDS *.td)
iree_cc_library(
diff --git a/iree/compiler/Dialect/Flow/IR/test/CMakeLists.txt b/iree/compiler/Dialect/Flow/IR/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/Flow/IR/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/Flow/IR/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/Flow/Transforms/CMakeLists.txt b/iree/compiler/Dialect/Flow/Transforms/CMakeLists.txt
index 9e19d32..406aea1 100644
--- a/iree/compiler/Dialect/Flow/Transforms/CMakeLists.txt
+++ b/iree/compiler/Dialect/Flow/Transforms/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/Flow/Transforms/test/CMakeLists.txt b/iree/compiler/Dialect/Flow/Transforms/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/Flow/Transforms/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/Flow/Transforms/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/Flow/Utils/CMakeLists.txt b/iree/compiler/Dialect/Flow/Utils/CMakeLists.txt
index 39f9b8d..e21d77b 100644
--- a/iree/compiler/Dialect/Flow/Utils/CMakeLists.txt
+++ b/iree/compiler/Dialect/Flow/Utils/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
Utils
diff --git a/iree/compiler/Dialect/HAL/CMakeLists.txt b/iree/compiler/Dialect/HAL/CMakeLists.txt
index f84e1ef..743555f 100644
--- a/iree/compiler/Dialect/HAL/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/CMakeLists.txt
@@ -12,11 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(Conversion)
-add_subdirectory(IR)
-add_subdirectory(Target)
-add_subdirectory(Transforms)
-add_subdirectory(Utils)
+iree_add_all_subdirs()
iree_cc_embed_data(
NAME
diff --git a/iree/compiler/Dialect/HAL/Conversion/CMakeLists.txt b/iree/compiler/Dialect/HAL/Conversion/CMakeLists.txt
index 04b155d..c73e21f 100644
--- a/iree/compiler/Dialect/HAL/Conversion/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Conversion/CMakeLists.txt
@@ -12,8 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(FlowToHAL)
-add_subdirectory(HALToVM)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/HAL/Conversion/FlowToHAL/CMakeLists.txt b/iree/compiler/Dialect/HAL/Conversion/FlowToHAL/CMakeLists.txt
index c7019d0..f5dffc4 100644
--- a/iree/compiler/Dialect/HAL/Conversion/FlowToHAL/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Conversion/FlowToHAL/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/HAL/Conversion/FlowToHAL/test/CMakeLists.txt b/iree/compiler/Dialect/HAL/Conversion/FlowToHAL/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/HAL/Conversion/FlowToHAL/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Conversion/FlowToHAL/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/HAL/Conversion/HALToVM/CMakeLists.txt b/iree/compiler/Dialect/HAL/Conversion/HALToVM/CMakeLists.txt
index 338cb28..e62a080 100644
--- a/iree/compiler/Dialect/HAL/Conversion/HALToVM/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Conversion/HALToVM/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/HAL/Conversion/HALToVM/test/CMakeLists.txt b/iree/compiler/Dialect/HAL/Conversion/HALToVM/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/HAL/Conversion/HALToVM/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Conversion/HALToVM/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/HAL/IR/CMakeLists.txt b/iree/compiler/Dialect/HAL/IR/CMakeLists.txt
index 5f21ab9..bc1a963 100644
--- a/iree/compiler/Dialect/HAL/IR/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/IR/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
file(GLOB _GLOB_X_TD CONFIGURE_DEPENDS *.td)
iree_cc_library(
diff --git a/iree/compiler/Dialect/HAL/IR/test/CMakeLists.txt b/iree/compiler/Dialect/HAL/IR/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/HAL/IR/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/IR/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/HAL/Target/CMakeLists.txt b/iree/compiler/Dialect/HAL/Target/CMakeLists.txt
index 370be0d..03f10d5 100644
--- a/iree/compiler/Dialect/HAL/Target/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Target/CMakeLists.txt
@@ -12,11 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(LLVM)
-add_subdirectory(LegacyInterpreter)
-add_subdirectory(VMLA)
-add_subdirectory(VulkanSPIRV)
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/HAL/Target/LLVM/CMakeLists.txt b/iree/compiler/Dialect/HAL/Target/LLVM/CMakeLists.txt
index 57aca5d..61b3286 100644
--- a/iree/compiler/Dialect/HAL/Target/LLVM/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Target/LLVM/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/HAL/Target/LLVM/test/CMakeLists.txt b/iree/compiler/Dialect/HAL/Target/LLVM/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/HAL/Target/LLVM/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Target/LLVM/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/HAL/Target/LegacyInterpreter/CMakeLists.txt b/iree/compiler/Dialect/HAL/Target/LegacyInterpreter/CMakeLists.txt
index d0d1986..c7c69e5 100644
--- a/iree/compiler/Dialect/HAL/Target/LegacyInterpreter/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Target/LegacyInterpreter/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
LegacyInterpreter
diff --git a/iree/compiler/Dialect/HAL/Target/VMLA/CMakeLists.txt b/iree/compiler/Dialect/HAL/Target/VMLA/CMakeLists.txt
index 99caeaf..c9d8b19 100644
--- a/iree/compiler/Dialect/HAL/Target/VMLA/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Target/VMLA/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/HAL/Target/VMLA/test/CMakeLists.txt b/iree/compiler/Dialect/HAL/Target/VMLA/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/HAL/Target/VMLA/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Target/VMLA/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/CMakeLists.txt b/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/CMakeLists.txt
index b16f5fd..00311d8 100644
--- a/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Target/VulkanSPIRV/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
VulkanSPIRV
diff --git a/iree/compiler/Dialect/HAL/Target/test/CMakeLists.txt b/iree/compiler/Dialect/HAL/Target/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/HAL/Target/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Target/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/HAL/Transforms/CMakeLists.txt b/iree/compiler/Dialect/HAL/Transforms/CMakeLists.txt
index 8f33478..2ced647 100644
--- a/iree/compiler/Dialect/HAL/Transforms/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Transforms/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/HAL/Transforms/test/CMakeLists.txt b/iree/compiler/Dialect/HAL/Transforms/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/HAL/Transforms/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Transforms/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/HAL/Utils/CMakeLists.txt b/iree/compiler/Dialect/HAL/Utils/CMakeLists.txt
index 25c3708..71a7cd9 100644
--- a/iree/compiler/Dialect/HAL/Utils/CMakeLists.txt
+++ b/iree/compiler/Dialect/HAL/Utils/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
Utils
diff --git a/iree/compiler/Dialect/IREE/CMakeLists.txt b/iree/compiler/Dialect/IREE/CMakeLists.txt
index 3993c38..8b864e5 100644
--- a/iree/compiler/Dialect/IREE/CMakeLists.txt
+++ b/iree/compiler/Dialect/IREE/CMakeLists.txt
@@ -12,6 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(Conversion)
-add_subdirectory(IR)
-add_subdirectory(Transforms)
+iree_add_all_subdirs()
diff --git a/iree/compiler/Dialect/IREE/Conversion/CMakeLists.txt b/iree/compiler/Dialect/IREE/Conversion/CMakeLists.txt
index 25bf422..5f260e1 100644
--- a/iree/compiler/Dialect/IREE/Conversion/CMakeLists.txt
+++ b/iree/compiler/Dialect/IREE/Conversion/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
PreserveCompilerHints
diff --git a/iree/compiler/Dialect/IREE/IR/CMakeLists.txt b/iree/compiler/Dialect/IREE/IR/CMakeLists.txt
index 23252fa..ce0fb90 100644
--- a/iree/compiler/Dialect/IREE/IR/CMakeLists.txt
+++ b/iree/compiler/Dialect/IREE/IR/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
file(GLOB _GLOB_X_TD CONFIGURE_DEPENDS *.td)
iree_cc_library(
diff --git a/iree/compiler/Dialect/IREE/IR/test/CMakeLists.txt b/iree/compiler/Dialect/IREE/IR/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/IREE/IR/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/IREE/IR/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/IREE/Transforms/CMakeLists.txt b/iree/compiler/Dialect/IREE/Transforms/CMakeLists.txt
index a21488a..ed3e96b 100644
--- a/iree/compiler/Dialect/IREE/Transforms/CMakeLists.txt
+++ b/iree/compiler/Dialect/IREE/Transforms/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/IREE/Transforms/test/CMakeLists.txt b/iree/compiler/Dialect/IREE/Transforms/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/IREE/Transforms/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/IREE/Transforms/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/Modules/CMakeLists.txt b/iree/compiler/Dialect/Modules/CMakeLists.txt
index 8cfbd5b..15e9263 100644
--- a/iree/compiler/Dialect/Modules/CMakeLists.txt
+++ b/iree/compiler/Dialect/Modules/CMakeLists.txt
@@ -12,5 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(Strings)
-add_subdirectory(TensorList)
+iree_add_all_subdirs()
diff --git a/iree/compiler/Dialect/Modules/Strings/CMakeLists.txt b/iree/compiler/Dialect/Modules/Strings/CMakeLists.txt
index bc82a8b..034d695 100644
--- a/iree/compiler/Dialect/Modules/Strings/CMakeLists.txt
+++ b/iree/compiler/Dialect/Modules/Strings/CMakeLists.txt
@@ -12,8 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(Conversion)
-add_subdirectory(IR)
+iree_add_all_subdirs()
iree_cc_embed_data(
NAME
diff --git a/iree/compiler/Dialect/Modules/Strings/Conversion/CMakeLists.txt b/iree/compiler/Dialect/Modules/Strings/Conversion/CMakeLists.txt
index 1553270..50a0de5 100644
--- a/iree/compiler/Dialect/Modules/Strings/Conversion/CMakeLists.txt
+++ b/iree/compiler/Dialect/Modules/Strings/Conversion/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
Conversion
diff --git a/iree/compiler/Dialect/Modules/Strings/IR/CMakeLists.txt b/iree/compiler/Dialect/Modules/Strings/IR/CMakeLists.txt
index 7b06647..42cac88 100644
--- a/iree/compiler/Dialect/Modules/Strings/IR/CMakeLists.txt
+++ b/iree/compiler/Dialect/Modules/Strings/IR/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
file(GLOB _GLOB_X_TD CONFIGURE_DEPENDS *.td)
iree_cc_library(
diff --git a/iree/compiler/Dialect/Modules/Strings/IR/test/CMakeLists.txt b/iree/compiler/Dialect/Modules/Strings/IR/test/CMakeLists.txt
index 02a5e97..79c0448 100644
--- a/iree/compiler/Dialect/Modules/Strings/IR/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/Modules/Strings/IR/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/Modules/TensorList/CMakeLists.txt b/iree/compiler/Dialect/Modules/TensorList/CMakeLists.txt
index 1c23456..2ab4319 100644
--- a/iree/compiler/Dialect/Modules/TensorList/CMakeLists.txt
+++ b/iree/compiler/Dialect/Modules/TensorList/CMakeLists.txt
@@ -12,8 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(Conversion)
-add_subdirectory(IR)
+iree_add_all_subdirs()
file(GLOB _GLOB_X_TD CONFIGURE_DEPENDS *.td)
iree_cc_embed_data(
diff --git a/iree/compiler/Dialect/Modules/TensorList/Conversion/CMakeLists.txt b/iree/compiler/Dialect/Modules/TensorList/Conversion/CMakeLists.txt
index 28371a9..4eda16b 100644
--- a/iree/compiler/Dialect/Modules/TensorList/Conversion/CMakeLists.txt
+++ b/iree/compiler/Dialect/Modules/TensorList/Conversion/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/Modules/TensorList/Conversion/test/CMakeLists.txt b/iree/compiler/Dialect/Modules/TensorList/Conversion/test/CMakeLists.txt
index c1d1c62..a83ec11 100644
--- a/iree/compiler/Dialect/Modules/TensorList/Conversion/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/Modules/TensorList/Conversion/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/Modules/TensorList/IR/CMakeLists.txt b/iree/compiler/Dialect/Modules/TensorList/IR/CMakeLists.txt
index bfec0f3..ccf453c 100644
--- a/iree/compiler/Dialect/Modules/TensorList/IR/CMakeLists.txt
+++ b/iree/compiler/Dialect/Modules/TensorList/IR/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
file(GLOB _GLOB_X_TD CONFIGURE_DEPENDS *.td)
iree_cc_library(
diff --git a/iree/compiler/Dialect/Modules/TensorList/IR/test/CMakeLists.txt b/iree/compiler/Dialect/Modules/TensorList/IR/test/CMakeLists.txt
index c1d1c62..a83ec11 100644
--- a/iree/compiler/Dialect/Modules/TensorList/IR/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/Modules/TensorList/IR/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/Shape/CMakeLists.txt b/iree/compiler/Dialect/Shape/CMakeLists.txt
index a9573e0..8b864e5 100644
--- a/iree/compiler/Dialect/Shape/CMakeLists.txt
+++ b/iree/compiler/Dialect/Shape/CMakeLists.txt
@@ -12,6 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(IR)
-add_subdirectory(Plugins)
-add_subdirectory(Transforms)
+iree_add_all_subdirs()
diff --git a/iree/compiler/Dialect/Shape/IR/CMakeLists.txt b/iree/compiler/Dialect/Shape/IR/CMakeLists.txt
index 6a41172..800ac31 100644
--- a/iree/compiler/Dialect/Shape/IR/CMakeLists.txt
+++ b/iree/compiler/Dialect/Shape/IR/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
file(GLOB _GLOB_X_TD CONFIGURE_DEPENDS *.td)
iree_cc_library(
diff --git a/iree/compiler/Dialect/Shape/IR/test/CMakeLists.txt b/iree/compiler/Dialect/Shape/IR/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/Shape/IR/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/Shape/IR/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/Shape/Plugins/CMakeLists.txt b/iree/compiler/Dialect/Shape/Plugins/CMakeLists.txt
index bf35922..15e9263 100644
--- a/iree/compiler/Dialect/Shape/Plugins/CMakeLists.txt
+++ b/iree/compiler/Dialect/Shape/Plugins/CMakeLists.txt
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(XLA)
+iree_add_all_subdirs()
diff --git a/iree/compiler/Dialect/Shape/Plugins/XLA/CMakeLists.txt b/iree/compiler/Dialect/Shape/Plugins/XLA/CMakeLists.txt
index 50601d5..8966a09 100644
--- a/iree/compiler/Dialect/Shape/Plugins/XLA/CMakeLists.txt
+++ b/iree/compiler/Dialect/Shape/Plugins/XLA/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/Shape/Plugins/XLA/test/CMakeLists.txt b/iree/compiler/Dialect/Shape/Plugins/XLA/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/Shape/Plugins/XLA/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/Shape/Plugins/XLA/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/Shape/Transforms/CMakeLists.txt b/iree/compiler/Dialect/Shape/Transforms/CMakeLists.txt
index accadbd..564de34 100644
--- a/iree/compiler/Dialect/Shape/Transforms/CMakeLists.txt
+++ b/iree/compiler/Dialect/Shape/Transforms/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/Shape/Transforms/test/CMakeLists.txt b/iree/compiler/Dialect/Shape/Transforms/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/Shape/Transforms/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/Shape/Transforms/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/VM/Analysis/CMakeLists.txt b/iree/compiler/Dialect/VM/Analysis/CMakeLists.txt
index f41d060..2908139 100644
--- a/iree/compiler/Dialect/VM/Analysis/CMakeLists.txt
+++ b/iree/compiler/Dialect/VM/Analysis/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/VM/Analysis/test/CMakeLists.txt b/iree/compiler/Dialect/VM/Analysis/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/VM/Analysis/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/VM/Analysis/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/VM/CMakeLists.txt b/iree/compiler/Dialect/VM/CMakeLists.txt
index 837780e..8b864e5 100644
--- a/iree/compiler/Dialect/VM/CMakeLists.txt
+++ b/iree/compiler/Dialect/VM/CMakeLists.txt
@@ -12,9 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(Analysis)
-add_subdirectory(Conversion)
-add_subdirectory(IR)
-add_subdirectory(Target)
-add_subdirectory(Tools)
-add_subdirectory(Transforms)
+iree_add_all_subdirs()
diff --git a/iree/compiler/Dialect/VM/Conversion/CMakeLists.txt b/iree/compiler/Dialect/VM/Conversion/CMakeLists.txt
index 8c1ba05..b742321 100644
--- a/iree/compiler/Dialect/VM/Conversion/CMakeLists.txt
+++ b/iree/compiler/Dialect/VM/Conversion/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(StandardToVM)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/VM/Conversion/StandardToVM/CMakeLists.txt b/iree/compiler/Dialect/VM/Conversion/StandardToVM/CMakeLists.txt
index d203703..cab2dfd 100644
--- a/iree/compiler/Dialect/VM/Conversion/StandardToVM/CMakeLists.txt
+++ b/iree/compiler/Dialect/VM/Conversion/StandardToVM/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/VM/Conversion/StandardToVM/test/CMakeLists.txt b/iree/compiler/Dialect/VM/Conversion/StandardToVM/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/VM/Conversion/StandardToVM/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/VM/Conversion/StandardToVM/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/VM/IR/CMakeLists.txt b/iree/compiler/Dialect/VM/IR/CMakeLists.txt
index aecf10d..5f4f995 100644
--- a/iree/compiler/Dialect/VM/IR/CMakeLists.txt
+++ b/iree/compiler/Dialect/VM/IR/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
file(GLOB _GLOB_X_TD CONFIGURE_DEPENDS *.td)
iree_cc_library(
diff --git a/iree/compiler/Dialect/VM/IR/test/CMakeLists.txt b/iree/compiler/Dialect/VM/IR/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/VM/IR/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/VM/IR/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/VM/Target/Bytecode/CMakeLists.txt b/iree/compiler/Dialect/VM/Target/Bytecode/CMakeLists.txt
index a10fc1c..9474bcb 100644
--- a/iree/compiler/Dialect/VM/Target/Bytecode/CMakeLists.txt
+++ b/iree/compiler/Dialect/VM/Target/Bytecode/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/VM/Target/Bytecode/test/CMakeLists.txt b/iree/compiler/Dialect/VM/Target/Bytecode/test/CMakeLists.txt
index 2edd48a..ccdd396 100644
--- a/iree/compiler/Dialect/VM/Target/Bytecode/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/VM/Target/Bytecode/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/VM/Target/CMakeLists.txt b/iree/compiler/Dialect/VM/Target/CMakeLists.txt
index ccb92de..8b864e5 100644
--- a/iree/compiler/Dialect/VM/Target/CMakeLists.txt
+++ b/iree/compiler/Dialect/VM/Target/CMakeLists.txt
@@ -12,4 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(Bytecode)
+iree_add_all_subdirs()
diff --git a/iree/compiler/Dialect/VM/Tools/CMakeLists.txt b/iree/compiler/Dialect/VM/Tools/CMakeLists.txt
index 7773381..cec6040 100644
--- a/iree/compiler/Dialect/VM/Tools/CMakeLists.txt
+++ b/iree/compiler/Dialect/VM/Tools/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
Tools
diff --git a/iree/compiler/Dialect/VM/Transforms/CMakeLists.txt b/iree/compiler/Dialect/VM/Transforms/CMakeLists.txt
index 7489209..aae9ef8 100644
--- a/iree/compiler/Dialect/VM/Transforms/CMakeLists.txt
+++ b/iree/compiler/Dialect/VM/Transforms/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/VM/Transforms/test/CMakeLists.txt b/iree/compiler/Dialect/VM/Transforms/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/VM/Transforms/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/VM/Transforms/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/VMLA/CMakeLists.txt b/iree/compiler/Dialect/VMLA/CMakeLists.txt
index e2294e7..28384d6 100644
--- a/iree/compiler/Dialect/VMLA/CMakeLists.txt
+++ b/iree/compiler/Dialect/VMLA/CMakeLists.txt
@@ -12,9 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(Conversion)
-add_subdirectory(IR)
-add_subdirectory(Transforms)
+iree_add_all_subdirs()
iree_cc_embed_data(
NAME
diff --git a/iree/compiler/Dialect/VMLA/Conversion/CMakeLists.txt b/iree/compiler/Dialect/VMLA/Conversion/CMakeLists.txt
index 8bc9e79..ddaec28 100644
--- a/iree/compiler/Dialect/VMLA/Conversion/CMakeLists.txt
+++ b/iree/compiler/Dialect/VMLA/Conversion/CMakeLists.txt
@@ -12,10 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(HALToVMLA)
-add_subdirectory(HLOToVMLA)
-add_subdirectory(StandardToVMLA)
-add_subdirectory(VMLAToVM)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/VMLA/Conversion/HALToVMLA/CMakeLists.txt b/iree/compiler/Dialect/VMLA/Conversion/HALToVMLA/CMakeLists.txt
index bfdd7e3..a5fcf32 100644
--- a/iree/compiler/Dialect/VMLA/Conversion/HALToVMLA/CMakeLists.txt
+++ b/iree/compiler/Dialect/VMLA/Conversion/HALToVMLA/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/VMLA/Conversion/HALToVMLA/test/CMakeLists.txt b/iree/compiler/Dialect/VMLA/Conversion/HALToVMLA/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/VMLA/Conversion/HALToVMLA/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/VMLA/Conversion/HALToVMLA/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/VMLA/Conversion/HLOToVMLA/CMakeLists.txt b/iree/compiler/Dialect/VMLA/Conversion/HLOToVMLA/CMakeLists.txt
index 9574f1f..731f787 100644
--- a/iree/compiler/Dialect/VMLA/Conversion/HLOToVMLA/CMakeLists.txt
+++ b/iree/compiler/Dialect/VMLA/Conversion/HLOToVMLA/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/VMLA/Conversion/HLOToVMLA/test/CMakeLists.txt b/iree/compiler/Dialect/VMLA/Conversion/HLOToVMLA/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/VMLA/Conversion/HLOToVMLA/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/VMLA/Conversion/HLOToVMLA/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/VMLA/Conversion/StandardToVMLA/CMakeLists.txt b/iree/compiler/Dialect/VMLA/Conversion/StandardToVMLA/CMakeLists.txt
index 35b48e3..84b2124 100644
--- a/iree/compiler/Dialect/VMLA/Conversion/StandardToVMLA/CMakeLists.txt
+++ b/iree/compiler/Dialect/VMLA/Conversion/StandardToVMLA/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/VMLA/Conversion/StandardToVMLA/test/CMakeLists.txt b/iree/compiler/Dialect/VMLA/Conversion/StandardToVMLA/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/VMLA/Conversion/StandardToVMLA/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/VMLA/Conversion/StandardToVMLA/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/VMLA/Conversion/VMLAToVM/CMakeLists.txt b/iree/compiler/Dialect/VMLA/Conversion/VMLAToVM/CMakeLists.txt
index 72bddce..57efd3c 100644
--- a/iree/compiler/Dialect/VMLA/Conversion/VMLAToVM/CMakeLists.txt
+++ b/iree/compiler/Dialect/VMLA/Conversion/VMLAToVM/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/VMLA/Conversion/VMLAToVM/test/CMakeLists.txt b/iree/compiler/Dialect/VMLA/Conversion/VMLAToVM/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/VMLA/Conversion/VMLAToVM/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/VMLA/Conversion/VMLAToVM/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/VMLA/IR/CMakeLists.txt b/iree/compiler/Dialect/VMLA/IR/CMakeLists.txt
index 85f9c85..591187e 100644
--- a/iree/compiler/Dialect/VMLA/IR/CMakeLists.txt
+++ b/iree/compiler/Dialect/VMLA/IR/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
file(GLOB _GLOB_X_TD CONFIGURE_DEPENDS *.td)
iree_cc_library(
diff --git a/iree/compiler/Dialect/VMLA/IR/test/CMakeLists.txt b/iree/compiler/Dialect/VMLA/IR/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/VMLA/IR/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/VMLA/IR/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/VMLA/Transforms/CMakeLists.txt b/iree/compiler/Dialect/VMLA/Transforms/CMakeLists.txt
index 6b374fe..e9a42ed 100644
--- a/iree/compiler/Dialect/VMLA/Transforms/CMakeLists.txt
+++ b/iree/compiler/Dialect/VMLA/Transforms/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/VMLA/Transforms/test/CMakeLists.txt b/iree/compiler/Dialect/VMLA/Transforms/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/VMLA/Transforms/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/VMLA/Transforms/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/Vulkan/CMakeLists.txt b/iree/compiler/Dialect/Vulkan/CMakeLists.txt
index b93f998..15e9263 100644
--- a/iree/compiler/Dialect/Vulkan/CMakeLists.txt
+++ b/iree/compiler/Dialect/Vulkan/CMakeLists.txt
@@ -12,5 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(IR)
-add_subdirectory(Utils)
+iree_add_all_subdirs()
diff --git a/iree/compiler/Dialect/Vulkan/IR/CMakeLists.txt b/iree/compiler/Dialect/Vulkan/IR/CMakeLists.txt
index 09c440a..865772b 100644
--- a/iree/compiler/Dialect/Vulkan/IR/CMakeLists.txt
+++ b/iree/compiler/Dialect/Vulkan/IR/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
file(GLOB _GLOB_X_TD CONFIGURE_DEPENDS *.td)
iree_cc_library(
diff --git a/iree/compiler/Dialect/Vulkan/IR/test/CMakeLists.txt b/iree/compiler/Dialect/Vulkan/IR/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/Vulkan/IR/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/Vulkan/IR/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Dialect/Vulkan/Utils/CMakeLists.txt b/iree/compiler/Dialect/Vulkan/Utils/CMakeLists.txt
index 7923f22..0da943c 100644
--- a/iree/compiler/Dialect/Vulkan/Utils/CMakeLists.txt
+++ b/iree/compiler/Dialect/Vulkan/Utils/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Dialect/Vulkan/Utils/test/CMakeLists.txt b/iree/compiler/Dialect/Vulkan/Utils/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Dialect/Vulkan/Utils/test/CMakeLists.txt
+++ b/iree/compiler/Dialect/Vulkan/Utils/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Translation/CMakeLists.txt b/iree/compiler/Translation/CMakeLists.txt
index 6a754a3..b692b63 100644
--- a/iree/compiler/Translation/CMakeLists.txt
+++ b/iree/compiler/Translation/CMakeLists.txt
@@ -12,11 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(CodegenUtils)
-add_subdirectory(Interpreter)
-add_subdirectory(SPIRV)
-add_subdirectory(XLAToLinalg)
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Translation/CodegenUtils/CMakeLists.txt b/iree/compiler/Translation/CodegenUtils/CMakeLists.txt
index 5d3848c..a0c13f7 100644
--- a/iree/compiler/Translation/CodegenUtils/CMakeLists.txt
+++ b/iree/compiler/Translation/CodegenUtils/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
CodegenUtils
diff --git a/iree/compiler/Translation/Interpreter/CMakeLists.txt b/iree/compiler/Translation/Interpreter/CMakeLists.txt
index d272b9c..8b864e5 100644
--- a/iree/compiler/Translation/Interpreter/CMakeLists.txt
+++ b/iree/compiler/Translation/Interpreter/CMakeLists.txt
@@ -12,7 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(IR)
-add_subdirectory(Serialization)
-add_subdirectory(Transforms)
-add_subdirectory(Utils)
+iree_add_all_subdirs()
diff --git a/iree/compiler/Translation/Interpreter/IR/CMakeLists.txt b/iree/compiler/Translation/Interpreter/IR/CMakeLists.txt
index 31cbce2..4d19ac0 100644
--- a/iree/compiler/Translation/Interpreter/IR/CMakeLists.txt
+++ b/iree/compiler/Translation/Interpreter/IR/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
file(GLOB _GLOB_X_TD CONFIGURE_DEPENDS *.td)
iree_cc_library(
diff --git a/iree/compiler/Translation/Interpreter/IR/test/CMakeLists.txt b/iree/compiler/Translation/Interpreter/IR/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Translation/Interpreter/IR/test/CMakeLists.txt
+++ b/iree/compiler/Translation/Interpreter/IR/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Translation/Interpreter/Serialization/CMakeLists.txt b/iree/compiler/Translation/Interpreter/Serialization/CMakeLists.txt
index bccd260..1e437a3 100644
--- a/iree/compiler/Translation/Interpreter/Serialization/CMakeLists.txt
+++ b/iree/compiler/Translation/Interpreter/Serialization/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
Serialization
diff --git a/iree/compiler/Translation/Interpreter/Transforms/CMakeLists.txt b/iree/compiler/Translation/Interpreter/Transforms/CMakeLists.txt
index e5cf231..d5b7ea0 100644
--- a/iree/compiler/Translation/Interpreter/Transforms/CMakeLists.txt
+++ b/iree/compiler/Translation/Interpreter/Transforms/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Translation/Interpreter/Transforms/test/CMakeLists.txt b/iree/compiler/Translation/Interpreter/Transforms/test/CMakeLists.txt
index 957b7dc..17d53b9 100644
--- a/iree/compiler/Translation/Interpreter/Transforms/test/CMakeLists.txt
+++ b/iree/compiler/Translation/Interpreter/Transforms/test/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(xla)
+iree_add_all_subdirs()
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
diff --git a/iree/compiler/Translation/Interpreter/Transforms/test/xla/CMakeLists.txt b/iree/compiler/Translation/Interpreter/Transforms/test/xla/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Translation/Interpreter/Transforms/test/xla/CMakeLists.txt
+++ b/iree/compiler/Translation/Interpreter/Transforms/test/xla/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Translation/Interpreter/Utils/CMakeLists.txt b/iree/compiler/Translation/Interpreter/Utils/CMakeLists.txt
index ea17921..c4b371a 100644
--- a/iree/compiler/Translation/Interpreter/Utils/CMakeLists.txt
+++ b/iree/compiler/Translation/Interpreter/Utils/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
Utils
diff --git a/iree/compiler/Translation/SPIRV/CMakeLists.txt b/iree/compiler/Translation/SPIRV/CMakeLists.txt
index a502d86..8b864e5 100644
--- a/iree/compiler/Translation/SPIRV/CMakeLists.txt
+++ b/iree/compiler/Translation/SPIRV/CMakeLists.txt
@@ -12,8 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(EmbeddedKernels)
-add_subdirectory(IndexComputation)
-add_subdirectory(LinalgToSPIRV)
-add_subdirectory(Passes)
-add_subdirectory(XLAToSPIRV)
+iree_add_all_subdirs()
diff --git a/iree/compiler/Translation/SPIRV/EmbeddedKernels/CMakeLists.txt b/iree/compiler/Translation/SPIRV/EmbeddedKernels/CMakeLists.txt
index ea4b480..a0a3d7b 100644
--- a/iree/compiler/Translation/SPIRV/EmbeddedKernels/CMakeLists.txt
+++ b/iree/compiler/Translation/SPIRV/EmbeddedKernels/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(Kernels)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Translation/SPIRV/EmbeddedKernels/Kernels/CMakeLists.txt b/iree/compiler/Translation/SPIRV/EmbeddedKernels/Kernels/CMakeLists.txt
index 94c2d6f..7eca88a 100644
--- a/iree/compiler/Translation/SPIRV/EmbeddedKernels/Kernels/CMakeLists.txt
+++ b/iree/compiler/Translation/SPIRV/EmbeddedKernels/Kernels/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_spirv_kernel_cc_library(
NAME
Kernels
diff --git a/iree/compiler/Translation/SPIRV/IndexComputation/CMakeLists.txt b/iree/compiler/Translation/SPIRV/IndexComputation/CMakeLists.txt
index 760a1d2..8e06ee4 100644
--- a/iree/compiler/Translation/SPIRV/IndexComputation/CMakeLists.txt
+++ b/iree/compiler/Translation/SPIRV/IndexComputation/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_tablegen_library(
NAME
diff --git a/iree/compiler/Translation/SPIRV/IndexComputation/test/CMakeLists.txt b/iree/compiler/Translation/SPIRV/IndexComputation/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Translation/SPIRV/IndexComputation/test/CMakeLists.txt
+++ b/iree/compiler/Translation/SPIRV/IndexComputation/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Translation/SPIRV/LinalgToSPIRV/CMakeLists.txt b/iree/compiler/Translation/SPIRV/LinalgToSPIRV/CMakeLists.txt
index 0525bc1..f09a7d2 100644
--- a/iree/compiler/Translation/SPIRV/LinalgToSPIRV/CMakeLists.txt
+++ b/iree/compiler/Translation/SPIRV/LinalgToSPIRV/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
LinalgToSPIRV
diff --git a/iree/compiler/Translation/SPIRV/Passes/CMakeLists.txt b/iree/compiler/Translation/SPIRV/Passes/CMakeLists.txt
index 1504603..a2a991f 100644
--- a/iree/compiler/Translation/SPIRV/Passes/CMakeLists.txt
+++ b/iree/compiler/Translation/SPIRV/Passes/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
Passes
diff --git a/iree/compiler/Translation/SPIRV/XLAToSPIRV/CMakeLists.txt b/iree/compiler/Translation/SPIRV/XLAToSPIRV/CMakeLists.txt
index d0298f1..66d3a27 100644
--- a/iree/compiler/Translation/SPIRV/XLAToSPIRV/CMakeLists.txt
+++ b/iree/compiler/Translation/SPIRV/XLAToSPIRV/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Translation/SPIRV/XLAToSPIRV/test/CMakeLists.txt b/iree/compiler/Translation/SPIRV/XLAToSPIRV/test/CMakeLists.txt
index debe338..17d53b9 100644
--- a/iree/compiler/Translation/SPIRV/XLAToSPIRV/test/CMakeLists.txt
+++ b/iree/compiler/Translation/SPIRV/XLAToSPIRV/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Translation/XLAToLinalg/CMakeLists.txt b/iree/compiler/Translation/XLAToLinalg/CMakeLists.txt
index e142225..c3d5ba0 100644
--- a/iree/compiler/Translation/XLAToLinalg/CMakeLists.txt
+++ b/iree/compiler/Translation/XLAToLinalg/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/compiler/Translation/XLAToLinalg/test/CMakeLists.txt b/iree/compiler/Translation/XLAToLinalg/test/CMakeLists.txt
index d16bedb..75333e5 100644
--- a/iree/compiler/Translation/XLAToLinalg/test/CMakeLists.txt
+++ b/iree/compiler/Translation/XLAToLinalg/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Translation/test/CMakeLists.txt b/iree/compiler/Translation/test/CMakeLists.txt
index 56202e0..0fb4804 100644
--- a/iree/compiler/Translation/test/CMakeLists.txt
+++ b/iree/compiler/Translation/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/compiler/Utils/CMakeLists.txt b/iree/compiler/Utils/CMakeLists.txt
index aa87771..9acc62b 100644
--- a/iree/compiler/Utils/CMakeLists.txt
+++ b/iree/compiler/Utils/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
Utils
diff --git a/iree/hal/CMakeLists.txt b/iree/hal/CMakeLists.txt
index ddffcf1..add7343 100644
--- a/iree/hal/CMakeLists.txt
+++ b/iree/hal/CMakeLists.txt
@@ -12,13 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(cts)
-add_subdirectory(host)
-add_subdirectory(interpreter)
-add_subdirectory(llvmjit)
-add_subdirectory(testing)
-add_subdirectory(vmla)
-add_subdirectory(vulkan)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/hal/cts/CMakeLists.txt b/iree/hal/cts/CMakeLists.txt
index 017ba15..94705cc 100644
--- a/iree/hal/cts/CMakeLists.txt
+++ b/iree/hal/cts/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
cts_test_base
diff --git a/iree/hal/host/CMakeLists.txt b/iree/hal/host/CMakeLists.txt
index 9ebfd2e..801b6b2 100644
--- a/iree/hal/host/CMakeLists.txt
+++ b/iree/hal/host/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
async_command_queue
diff --git a/iree/hal/interpreter/CMakeLists.txt b/iree/hal/interpreter/CMakeLists.txt
index 49383d1..4f3cdcd 100644
--- a/iree/hal/interpreter/CMakeLists.txt
+++ b/iree/hal/interpreter/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
bytecode_cache
diff --git a/iree/hal/llvmjit/CMakeLists.txt b/iree/hal/llvmjit/CMakeLists.txt
index 4a92aec..95513b7 100644
--- a/iree/hal/llvmjit/CMakeLists.txt
+++ b/iree/hal/llvmjit/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
llvmjit_executable
diff --git a/iree/hal/testing/CMakeLists.txt b/iree/hal/testing/CMakeLists.txt
index d9b0231..e925403 100644
--- a/iree/hal/testing/CMakeLists.txt
+++ b/iree/hal/testing/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
mock_allocator
diff --git a/iree/hal/vmla/CMakeLists.txt b/iree/hal/vmla/CMakeLists.txt
index 917aacd..54f36a5 100644
--- a/iree/hal/vmla/CMakeLists.txt
+++ b/iree/hal/vmla/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
op_kernels
diff --git a/iree/modules/CMakeLists.txt b/iree/modules/CMakeLists.txt
index e1c45a8..15e9263 100644
--- a/iree/modules/CMakeLists.txt
+++ b/iree/modules/CMakeLists.txt
@@ -12,7 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(check)
-add_subdirectory(hal)
-add_subdirectory(strings)
-add_subdirectory(tensorlist)
+iree_add_all_subdirs()
diff --git a/iree/modules/check/CMakeLists.txt b/iree/modules/check/CMakeLists.txt
index bdcebf3..660a778 100644
--- a/iree/modules/check/CMakeLists.txt
+++ b/iree/modules/check/CMakeLists.txt
@@ -12,8 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(dialect)
-add_subdirectory(test)
+iree_add_all_subdirs()
iree_bytecode_module(
NAME
diff --git a/iree/modules/check/dialect/test/CMakeLists.txt b/iree/modules/check/dialect/test/CMakeLists.txt
index a171444..efa9203 100644
--- a/iree/modules/check/dialect/test/CMakeLists.txt
+++ b/iree/modules/check/dialect/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/modules/check/test/CMakeLists.txt b/iree/modules/check/test/CMakeLists.txt
index 89ac22c..609f783 100644
--- a/iree/modules/check/test/CMakeLists.txt
+++ b/iree/modules/check/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/modules/hal/CMakeLists.txt b/iree/modules/hal/CMakeLists.txt
index dec39cb..cb03db2 100644
--- a/iree/modules/hal/CMakeLists.txt
+++ b/iree/modules/hal/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
hal
diff --git a/iree/modules/strings/CMakeLists.txt b/iree/modules/strings/CMakeLists.txt
index e29db4d..d0b532b 100644
--- a/iree/modules/strings/CMakeLists.txt
+++ b/iree/modules/strings/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
strings_module
diff --git a/iree/modules/tensorlist/CMakeLists.txt b/iree/modules/tensorlist/CMakeLists.txt
index d4511d7..0f4fd16 100644
--- a/iree/modules/tensorlist/CMakeLists.txt
+++ b/iree/modules/tensorlist/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_bytecode_module(
NAME
tensorlist_test_module
diff --git a/iree/samples/CMakeLists.txt b/iree/samples/CMakeLists.txt
index d30d11c..8b864e5 100644
--- a/iree/samples/CMakeLists.txt
+++ b/iree/samples/CMakeLists.txt
@@ -12,6 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(custom_modules)
-add_subdirectory(simple_embedding)
-add_subdirectory(vulkan)
+iree_add_all_subdirs()
diff --git a/iree/samples/custom_modules/CMakeLists.txt b/iree/samples/custom_modules/CMakeLists.txt
index e434bca..064899b 100644
--- a/iree/samples/custom_modules/CMakeLists.txt
+++ b/iree/samples/custom_modules/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(dialect)
+iree_add_all_subdirs()
iree_bytecode_module(
NAME
diff --git a/iree/samples/custom_modules/dialect/CMakeLists.txt b/iree/samples/custom_modules/dialect/CMakeLists.txt
index ddcc362..afe37b3 100644
--- a/iree/samples/custom_modules/dialect/CMakeLists.txt
+++ b/iree/samples/custom_modules/dialect/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(test)
+iree_add_all_subdirs()
file(GLOB _GLOB_X_TD CONFIGURE_DEPENDS *.td)
iree_cc_library(
diff --git a/iree/samples/custom_modules/dialect/test/CMakeLists.txt b/iree/samples/custom_modules/dialect/test/CMakeLists.txt
index 31f452f..000c9be 100644
--- a/iree/samples/custom_modules/dialect/test/CMakeLists.txt
+++ b/iree/samples/custom_modules/dialect/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/samples/simple_embedding/CMakeLists.txt b/iree/samples/simple_embedding/CMakeLists.txt
index 147e9cd..3125510 100644
--- a/iree/samples/simple_embedding/CMakeLists.txt
+++ b/iree/samples/simple_embedding/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_bytecode_module(
NAME
simple_embedding_test_bytecode_module
diff --git a/iree/schemas/CMakeLists.txt b/iree/schemas/CMakeLists.txt
index 2977391..ba5b8b9 100644
--- a/iree/schemas/CMakeLists.txt
+++ b/iree/schemas/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(bytecode)
+iree_add_all_subdirs()
flatbuffer_cc_library(
NAME
diff --git a/iree/schemas/bytecode/CMakeLists.txt b/iree/schemas/bytecode/CMakeLists.txt
index 6d6a015..747dcef 100644
--- a/iree/schemas/bytecode/CMakeLists.txt
+++ b/iree/schemas/bytecode/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
interpreter_bytecode_v0
diff --git a/iree/testing/CMakeLists.txt b/iree/testing/CMakeLists.txt
index 6b8c95c..aee5c49 100644
--- a/iree/testing/CMakeLists.txt
+++ b/iree/testing/CMakeLists.txt
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-add_subdirectory(internal)
+iree_add_all_subdirs()
iree_cc_library(
NAME
diff --git a/iree/testing/internal/CMakeLists.txt b/iree/testing/internal/CMakeLists.txt
index 07362c1..0ec32ae 100644
--- a/iree/testing/internal/CMakeLists.txt
+++ b/iree/testing/internal/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_library(
NAME
gtest_internal
diff --git a/iree/tools/test/CMakeLists.txt b/iree/tools/test/CMakeLists.txt
index f31003b..40e84f8 100644
--- a/iree/tools/test/CMakeLists.txt
+++ b/iree/tools/test/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
file(GLOB _GLOB_X_MLIR CONFIGURE_DEPENDS *.mlir)
iree_lit_test_suite(
NAME
diff --git a/iree/vm/CMakeLists.txt b/iree/vm/CMakeLists.txt
index 6f08fac..d0412cf 100644
--- a/iree/vm/CMakeLists.txt
+++ b/iree/vm/CMakeLists.txt
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+iree_add_all_subdirs()
+
iree_cc_test(
NAME
bytecode_dispatch_test