Move C runtime source directories into runtime/src/iree. (#8950)
* Pries apart the global include directory situation on both the Bazel and CMake side. On Bazel, we use a new iree_runtime_cc_(library|binary) macro that adds an implicit dep for include propagation and (in the future) can set copts.
* On the CMake side, we use a path-based implicit dep to similar effect. I tried a couple of other ways and this was the least intrusive.
* Reworks bazel_to_cmake target rewriting to account for the new split root.
* Removes the CMake DATA include::this:file.png style of data includes (used in one place) in favor of a path, since package names are no longer reversible to a location. This seems to be the only place we made that assumption.
* Will do a couple more followups to completely retire the iree/iree directory (in favor of top-level compiler/ and tools/ directories).
Progress on #8955
diff --git a/build_tools/bazel_to_cmake/bazel_to_cmake.py b/build_tools/bazel_to_cmake/bazel_to_cmake.py
index 51354c3..d8d1a03 100755
--- a/build_tools/bazel_to_cmake/bazel_to_cmake.py
+++ b/build_tools/bazel_to_cmake/bazel_to_cmake.py
@@ -71,15 +71,17 @@
" whether the directory is skipped."
" 2: Also output when conversion was successful.")
- # Specify only one of these (defaults to --root_dir=iree).
+ # Specify only one of these (defaults to --root_dir=<main source dirs>).
group = parser.add_mutually_exclusive_group()
group.add_argument("--dir",
help="Converts the BUILD file in the given directory",
default=None)
group.add_argument(
"--root_dir",
- help="Converts all BUILD files under a root directory (defaults to iree/)",
- default="iree")
+ nargs="+",
+ help=
+ "Converts all BUILD files under a root directory (defaults to iree, runtime)",
+ default=["iree", "runtime"])
args = parser.parse_args()
@@ -240,12 +242,14 @@
write_files = not args.preview
if args.root_dir:
- root_directory_path = os.path.join(repo_root, args.root_dir)
- log(f"Converting directory tree rooted at: {root_directory_path}")
- convert_directories((root for root, _, _ in os.walk(root_directory_path)),
- write_files=write_files,
- allow_partial_conversion=args.allow_partial_conversion,
- verbosity=args.verbosity)
+ for root_dir in args.root_dir:
+ root_directory_path = os.path.join(repo_root, root_dir)
+ log(f"Converting directory tree rooted at: {root_directory_path}")
+ convert_directories(
+ (root for root, _, _ in os.walk(root_directory_path)),
+ write_files=write_files,
+ allow_partial_conversion=args.allow_partial_conversion,
+ verbosity=args.verbosity)
elif args.dir:
convert_directories([os.path.join(repo_root, args.dir)],
write_files=write_files,