[cmake] Move inclusion of tools directory up (#11685)
Results in phony rules generated for both tools and Python to refer to
those in tools/ in short form. That is, iree-compile phony target now
refers to tools/iree-compile rather than the one inside _mlir_libs:
```sh
$ rg -e "build iree-dump-module" -e "build iree-lld" -e "build iree-compile" build.ninja
211387:build iree-compile: phony tools/iree-compile
211391:build iree-dump-module: phony tools/iree-dump-module
211397:build iree-lld: phony compiler/bindings/python/iree/compiler/_mlir_libs/iree-lld
```
Fixes #9329.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 54d1767..c8f8e88 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -756,16 +756,18 @@
add_subdirectory(benchmarks)
endif()
+# tools/ can depend on compiler/ and runtime/.
+# Note: tools sub directory is added before compiler/ so that phony targets for
+# files with the same names from different rules are disambiguated towards
+# those in tools/.
+add_subdirectory(tools)
+
if(IREE_BUILD_COMPILER)
add_subdirectory(compiler)
endif()
add_subdirectory(runtime)
-# tools/ can depend on compiler/ and runtime/
-add_subdirectory(tools)
-
-
if(IREE_ENABLE_CLANG_TIDY)
set(CMAKE_CXX_CLANG_TIDY "")
endif()